repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/pact/consumers/kafka_spec.rb
spec/pact/consumers/kafka_spec.rb
# frozen_string_literal: true require "pact/v2/rspec" RSpec.describe "Pact::V2::Consumers::Kafka", :pact_v2, skip_windows: true do message_pact_provider "pact-v2-test-app-kafka", opts: { pact_dir: File.expand_path('../../pacts', __dir__), message_handlers: { "pet message as json" => proc do |pro...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/features/consumer_with_file_upload_spec.rb
spec/features/consumer_with_file_upload_spec.rb
require 'net/http' require 'pact/consumer' require 'pact/consumer/rspec' require 'faraday' require 'faraday/multipart' load 'pact/consumer/world.rb' describe "A consumer with a file upload", :pact => true do before :all do Pact.clear_configuration Pact.clear_consumer_world Pact.service_consumer "Consum...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/features/production_spec.rb
spec/features/production_spec.rb
require 'spec_helper' require 'pact/provider/rspec' require 'pact/consumer_contract' require 'features/provider_states/zebras' require 'pact/provider/pact_source' module Pact::Provider describe "A service production side of a pact" do class ServiceUnderTest def call(env) case env['PATH_INFO'] ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/features/foo_bar_spec.rb
spec/features/foo_bar_spec.rb
require 'net/http' require 'pact/consumer' require 'pact/consumer/rspec' load 'pact/consumer/world.rb' # Use this test along with `rake pact:verify:foobar` to debug end to end issues. # The Bar app is in spec/support/bar_pact_helper.rb describe "Bar", :pact => true do it "can retrieve a thing" do Pact.clea...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/features/consumption_spec.rb
spec/features/consumption_spec.rb
require 'net/http' require 'pact/consumer' require 'pact/consumer/rspec' load 'pact/consumer/world.rb' describe "A service consumer side of a pact", :pact => true do before do Pact.clear_configuration Pact.clear_consumer_world end describe "blah" do describe "thing" do it "goes a little som...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/features/provider_states/zebras.rb
spec/features/provider_states/zebras.rb
require 'json' require 'fileutils' Pact.provider_states_for 'the-wild-beast-store' do provider_state :the_zebras_are_here do set_up do FileUtils.mkdir_p 'tmp' some_data = [{'name' => 'Jason'},{'name' => 'Sarah'}] File.open("tmp/a_mock_database.json", "w") { |file| file << some_data.to_json } ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/pkg/server/pet_store_pb.rb
spec/internal/pkg/server/pet_store_pb.rb
# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: pet_store.proto require "google/protobuf" descriptor_data = "\n:spec/internal/deps/services/pet_store/grpc/pet_store.proto\x12\x0cpet_store.v1\"U\n\x03Pet\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/pkg/server/pet_store_services_pb.rb
spec/internal/pkg/server/pet_store_services_pb.rb
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: pet_store.proto for package 'PetStore.Grpc.PetStore.V1' require "grpc" require_relative "pet_store_pb" module PetStore module Grpc module PetStore module V1 module Pets class Service include ::GRPC::GenericS...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/pkg/client/pet_store/grpc/pet_store_pb.rb
spec/internal/pkg/client/pet_store/grpc/pet_store_pb.rb
# frozen_string_literal: true # Generated by the protocol buffer compiler. DO NOT EDIT! # source: spec/internal/deps/services/pet_store/grpc/pet_store.proto require 'google/protobuf' descriptor_data = "\n:spec/internal/deps/services/pet_store/grpc/pet_store.proto\x12\x0cpet_store.v1\"U\n\x03Pet\x12\n\n\x02id\x18\x01...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/pkg/client/pet_store/grpc/pet_store_services_pb.rb
spec/internal/pkg/client/pet_store/grpc/pet_store_services_pb.rb
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: pet_store.proto for package 'PetStore.Grpc.PetStore.V1' require "grpc" require_relative "pet_store_pb" module PetStore module Grpc module PetStore module V1 module Pets class Service include ::GRPC::Generic...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/controllers/pets_controller.rb
spec/internal/app/controllers/pets_controller.rb
# frozen_string_literal: true class PetsController < ApplicationController def show render json: { pet: { id: params[:id].to_i, bark: true, breed: "Husky" } } end def update response.set_header("TRACE_ID", "xxx-xxx") render json: { pet: { id: par...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/controllers/application_controller.rb
spec/internal/app/controllers/application_controller.rb
# frozen_string_literal: true class ApplicationController < ActionController::API end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/rpc/pet_store/pet_store_controller.rb
spec/internal/app/rpc/pet_store/pet_store_controller.rb
# frozen_string_literal: true module PetStore class PetStoreController < Gruf::Controllers::Base bind PetStore::Grpc::PetStore::V1::Pets::Service def pet_by_id req = request.message PetStore::Grpc::PetStore::V1::PetResponse.new(pet: {id: req.id, name: "Jack"}, metadata: request.metadata) end...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/producers/test_message_producer.rb
spec/internal/app/producers/test_message_producer.rb
class TestMessageProducer def publish_message() message = { "email": "jane@example.com", "title": "Miss", "first_name": "Jane", "surname": "Doe" } end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/producers/pet_proto_producer.rb
spec/internal/app/producers/pet_proto_producer.rb
# frozen_string_literal: true class PetProtoProducer < Sbmt::KafkaProducer::BaseProducer option :topic, default: -> { "proto-topic" } option :uuid, default: -> { SecureRandom.uuid } option :serializer, default: -> { PetStore::Grpc::PetStore::V1::Pet } def call(pet_id) message = serializer.new( id: p...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/producers/pet_json_producer.rb
spec/internal/app/producers/pet_json_producer.rb
# frozen_string_literal: true class PetJsonProducer < Sbmt::KafkaProducer::BaseProducer option :topic, default: -> { "json-topic" } option :uuid, default: -> { SecureRandom.uuid } def call(pet_id) pet = { id: pet_id, tags: %w[tag1 tag2], colors: { red: { descr...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/consumers/pet_json_consumer.rb
spec/internal/app/consumers/pet_json_consumer.rb
# frozen_string_literal: true class PetJsonConsumer < Sbmt::KafkaConsumer::BaseConsumer def process_message(message) pet_id = message.payload["id"] Rails.logger.info "Pet ID: #{pet_id}" end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/consumers/test_message_consumer.rb
spec/internal/app/consumers/test_message_consumer.rb
class TestMessageConsumer def consume_message(message) puts "Message consumed" puts message.to_json message end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/app/consumers/pet_proto_consumer.rb
spec/internal/app/consumers/pet_proto_consumer.rb
# frozen_string_literal: true class PetProtoConsumer < Sbmt::KafkaConsumer::BaseConsumer def process_message(message) Rails.logger.info "Pet ID: #{message.payload.id}" end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/config/routes.rb
spec/internal/config/routes.rb
# frozen_string_literal: true Rails.application.routes.draw do resources :pets end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/internal/config/initializers/grpc_server.rb
spec/internal/config/initializers/grpc_server.rb
# frozen_string_literal: true ::Gruf.interceptors.clear ::Gruf.configure do |c| c.server_binding_url = "0.0.0.0:3009" c.logger = Rails.logger end puts "Loading gRPC service files from #{Rails.root}" required_files = [] required_files += Rails.root.glob("pkg/server/**/*_services_pb.rb").sort required_files += Rai...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/service_providers/pact_ruby_fetch_pacts_for_verification_test.rb
spec/service_providers/pact_ruby_fetch_pacts_for_verification_test.rb
require_relative 'helper' require 'pact/pact_broker/fetch_pact_uris_for_verification' describe Pact::PactBroker::FetchPactURIsForVerification, pact: true do before do allow($stdout).to receive(:puts) end let(:get_headers) { { "Accept" => 'application/hal+json' } } let(:post_headers) do { "Accept...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/service_providers/pact_ruby_fetch_pacts_test.rb
spec/service_providers/pact_ruby_fetch_pacts_test.rb
require_relative 'helper' require 'pact/pact_broker/fetch_pacts' describe Pact::PactBroker::FetchPacts, pact: true do before do allow($stdout).to receive(:puts) end let(:get_headers) { { Accept: 'application/hal+json' } } describe 'fetch pacts' do let(:provider) { 'provider-1' } let(:broker_bas...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/service_providers/helper.rb
spec/service_providers/helper.rb
require 'pact/consumer/rspec' Pact.service_consumer 'Pact Ruby' do has_pact_with 'Pact Broker' do mock_service :pact_broker do port 8888 pact_specification_version '2.0.0' end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/configuration_spec.rb
spec/v2/pact/configuration_spec.rb
# frozen_string_literal: true RSpec.describe Pact::V2::Configuration do subject(:config) { described_class.new } describe "#before_provider_state_setup" do it "raises if block is not given" do expect { config.before_provider_state_setup }.to raise_error(/no block given/) end it "configures setu...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/generators_spec.rb
spec/v2/pact/generators_spec.rb
# frozen_string_literal: true require 'spec_helper' require 'pact/v2/generators' module Pact module V2 module Generators RSpec.describe RandomIntGenerator do subject { described_class.new(min: 1, max: 10) } describe '#as_basic' do it 'returns the correct hash' do exp...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/matchers_spec.rb
spec/v2/pact/matchers_spec.rb
# frozen_string_literal: true RSpec.describe Pact::V2::Matchers do subject(:test_class) { Class.new { extend Pact::V2::Matchers } } context "with basic format serialization" do it "properly builds matcher for UUID" do expect(test_class.match_uuid.as_basic).to eq({ "pact:matcher:type" => "regex",...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/provider/base_verifier_spec.rb
spec/v2/pact/provider/base_verifier_spec.rb
# frozen_string_literal: true describe Pact::V2::Provider::BaseVerifier do subject { described_class.new(Pact::V2::Provider::PactConfig::Base.new(provider_name: "provider")) } let(:build_selectors) { subject.send(:build_consumer_selectors, verify_only, consumer_name, consumer_branch) } context "when verify_onl...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/provider/pact_broker_proxy_runner_spec.rb
spec/v2/pact/provider/pact_broker_proxy_runner_spec.rb
# frozen_string_literal: true describe Pact::V2::Provider::PactBrokerProxyRunner do let(:http_client) do Faraday.new do |conn| conn.response :json conn.request :json end end let(:broker_host) { "https://example.org" } let(:proxy_host) { server.proxy_url } let(:make_request) { server.run ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/provider/provider_server_runner_spec.rb
spec/v2/pact/provider/provider_server_runner_spec.rb
# frozen_string_literal: true describe Pact::V2::Provider::ProviderServerRunner do let(:http_client) do Faraday.new do |conn| conn.response :json conn.request :json end end let(:make_request) do server.run { http_client.post("http://localhost:9001/setup-provider", request_body) } end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/provider/gruf_server_spec.rb
spec/v2/pact/provider/gruf_server_spec.rb
# frozen_string_literal: true describe Pact::V2::Provider::GrufServer do let(:api) { ::PetStore::Grpc::PetStore::V1::Pets::Stub.new("localhost:3009", :this_channel_is_insecure) } let(:call_rpc) do subject.run { api.pet_by_id(PetStore::Grpc::PetStore::V1::PetByIdRequest.new(id: 1)) } end context "when succ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/consumer/message_interaction_builder_spec.rb
spec/v2/pact/consumer/message_interaction_builder_spec.rb
# frozen_string_literal: true RSpec.describe Pact::V2::Consumer::MessageInteractionBuilder do subject { described_class.new(nil) } context "when proto message is used" do let(:proto_path) { "spec/internal/deps/services/pet_store/grpc/pet_store.proto" } let(:builder) do subject .upon_receivin...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/consumer/interaction_contents_spec.rb
spec/v2/pact/consumer/interaction_contents_spec.rb
# frozen_string_literal: true RSpec.describe Pact::V2::Consumer::InteractionContents do include Pact::V2::Matchers let(:contents) do { str: match_any_string("str"), bool: match_any_boolean(true), num: match_any_number(1), nested: match_each( { a: 1, b: "2" ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/v2/pact/consumer/grpc_interaction_builder_spec.rb
spec/v2/pact/consumer/grpc_interaction_builder_spec.rb
# frozen_string_literal: true RSpec.describe Pact::V2::Consumer::GrpcInteractionBuilder do subject { described_class.new(nil) } let(:proto_path) { Rails.root.join("deps/services/pet_store/grpc/pet_store.proto").to_s } let(:builder) do subject .with_service(proto_path, "Pets/PetById") .with_reque...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/configuration_spec.rb
spec/lib/pact/configuration_spec.rb
require 'spec_helper' require 'pact/configuration' describe Pact do before do Pact.clear_configuration end describe "configure" do KEY_VALUE_PAIRS = {pact_dir: 'a path', log_dir: 'a dir', logger: 'a logger'} KEY_VALUE_PAIRS.each do | key, value | it "should allow configuration of #{key}" do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/cli_spec.rb
spec/lib/pact/cli_spec.rb
require 'pact/cli' require 'pact/cli/generate_pact_docs' require 'pact/doc/generator' module Pact describe CLI do describe "docs" do let(:docs) { subject.invoke :docs } before do allow(Pact::Doc::Generate).to receive(:call) end it "generates Markdown documentation" do e...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/pact_broker_spec.rb
spec/lib/pact/pact_broker_spec.rb
require 'pact/pact_broker' require 'pact/provider/pact_uri' module Pact module PactBroker describe ".fetch_pact_uris_for_verification" do before do allow(Pact::PactBroker::FetchPactURIsForVerification).to receive(:call).and_return([pact_uri]) end let(:pact_uri) { Pact::Provider::PactUR...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/tasks/task_helper_spec.rb
spec/lib/pact/tasks/task_helper_spec.rb
require 'spec_helper' require 'pact/tasks/task_helper' require 'rake/file_utils' module Pact describe TaskHelper do describe ".execute_pact_verify" do let(:ruby_path) { "/path/to/ruby" } let(:pact_uri) { "/pact/uri" } let(:default_pact_helper_path) { "/pact/helper/path.rb" } let(:verifica...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/tasks/verification_task_spec.rb
spec/lib/pact/tasks/verification_task_spec.rb
require 'spec_helper' require 'pact/tasks/verification_task' require 'pact/tasks/task_helper' module Pact describe VerificationTask do before :all do @pact_helper = '/custom/path/pact_helper .rb' @pact_uri = 'http://example.org/pact.json' @task_name = 'pact:verify:pact_rake_spec' @task_n...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/hal/http_client_spec.rb
spec/lib/pact/hal/http_client_spec.rb
require 'pact/hal/http_client' require "faraday" require "faraday/retry" module Pact module Hal describe HttpClient do before do allow(Retry).to receive(:until_true) { |&block| block.call } end subject { HttpClient.new(username: 'foo', password: 'bar') } describe "get" do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/hal/authorization_header_redactor_spec.rb
spec/lib/pact/hal/authorization_header_redactor_spec.rb
require 'pact/hal/authorization_header_redactor' module Pact module Hal describe AuthorizationHeaderRedactor do let(:stream) { StringIO.new } let(:stream_redactor) { AuthorizationHeaderRedactor.new(stream) } it "redacts the authorizaton header" do stream_redactor << "\\r\\nAuthorizatio...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/hal/link_spec.rb
spec/lib/pact/hal/link_spec.rb
require 'pact/hal/link' require 'pact/hal/entity' require 'pact/hal/http_client' module Pact module Hal describe Link do let(:http_client) do instance_double('Pact::Hal::HttpClient', post: response) end let(:response) do instance_double('Pact::Hal::HttpClient::Response', succes...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/hal/entity_spec.rb
spec/lib/pact/hal/entity_spec.rb
require 'pact/hal/entity' require 'pact/hal/http_client' module Pact module Hal describe Entity do let(:http_client) do instance_double('Pact::Hal::HttpClient', post: provider_response) end let(:provider_response) do double('response', body: provider_hash, success?: true, json?...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/pact_broker/fetch_pacts_spec.rb
spec/lib/pact/pact_broker/fetch_pacts_spec.rb
require 'pact/pact_broker/fetch_pacts' module Pact module PactBroker describe FetchPacts do describe "call" do before do allow(Pact.configuration).to receive(:output_stream).and_return(double('output stream').as_null_object) stub_request(:get, "http://broker.org/").to_return(sta...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/pact_broker/pact_selection_description_spec.rb
spec/lib/pact/pact_broker/pact_selection_description_spec.rb
require 'pact/pact_broker/pact_selection_description' module Pact module PactBroker describe PactSelectionDescription do include PactSelectionDescription describe "#pact_selection_description" do let(:provider) { "Bar" } let(:consumer_version_selectors) { [{ tag: "cmaster", latest: t...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb
spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb
require 'pact/pact_broker/fetch_pact_uris_for_verification' module Pact module PactBroker describe FetchPactURIsForVerification do describe "call" do before do allow(Pact.configuration).to receive(:output_stream).and_return(double('output stream').as_null_object) end let(...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/pact_broker/notices_spec.rb
spec/lib/pact/pact_broker/notices_spec.rb
require 'pact/pact_broker/notices' module Pact module PactBroker describe Notices do let(:notice_hashes) do [ { text: "foo", when: "before_verification" } ] end subject(:notices) { Notices.new(notice_hashes) } it "behaves like an array" do expect(subje...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/utils/metrics_spec.rb
spec/lib/pact/utils/metrics_spec.rb
require "pact/utils/metrics" describe Pact::Utils::Metrics do describe ".report_metric" do before do ENV["COMPUTERNAME"] = "test" ENV["HOSTNAME"] = "test" stub_request(:post, "https://www.google-analytics.com/collect").to_return(status: 200, body: "", headers: {}) stub_const("RUBY_PLATFOR...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/request_spec.rb
spec/lib/pact/provider/request_spec.rb
require 'spec_helper' require 'pact/provider/request' describe Pact::Provider::Request::Replayable do let(:path) { '/path?something' } let(:body) { { a: 'body' } } let(:headers) { {} } let(:generators) { {} } let(:expected_request) do instance_double( 'Pact::Request::Expected', method: 'post...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration_spec.rb
spec/lib/pact/provider/configuration_spec.rb
require 'spec_helper' require 'pact/provider/configuration' module Pact::Provider::Configuration describe ConfigurationExtension do before do Pact.clear_configuration end describe "service_provider" do context "when a provider is configured" do before do Pact.service_pr...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/rspec_spec.rb
spec/lib/pact/provider/rspec_spec.rb
require 'pact/provider/rspec/matchers' require 'pact/shared/json_differ' require 'pact/matchers/unix_diff_formatter' describe "the match_term matcher" do include Pact::RSpec::Matchers let(:diff_formatter) { Pact::Matchers::UnixDiffFormatter } it 'does not match a hash to an array' do | example | expect({...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/pact_helper_locator_spec.rb
spec/lib/pact/provider/pact_helper_locator_spec.rb
require 'spec_helper' require 'pact/provider/pact_helper_locator' module Pact::Provider describe PactHelperLocater do describe "pact_helper_path", :fakefs => true, skip_jruby: true do subject { PactHelperLocater.pact_helper_path } def make_pactfile dir FileUtils.mkdir_p ".#{dir}" F...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/print_missing_provider_states_spec.rb
spec/lib/pact/provider/print_missing_provider_states_spec.rb
require 'spec_helper' require 'pact/provider/print_missing_provider_states' module Pact module Provider describe PrintMissingProviderStates do describe "text" do let(:missing_provider_states) { { 'Consumer 1' => ['state1', 'state2'], 'Consumer 2' => ['state3'] } } let(:expected_output) { F...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/pact_spec_runner_spec.rb
spec/lib/pact/provider/pact_spec_runner_spec.rb
require 'pact/provider/pact_spec_runner' describe Pact::Provider::PactSpecRunner, skip_jruby: true do let(:options) { {provider: double(:provider)} } let(:pact_url) { double(:pact_url, uri: 'uri', options: {}) } let(:pact_urls) { [pact_url] } subject { described_class.new(pact_urls, options) } let(:interact...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/generators_spec.rb
spec/lib/pact/provider/generators_spec.rb
require 'pact/generators' require 'pact/provider/request' describe Pact::Generators do it 'apply_generators for path' do expected_request = Pact::Request::Expected.from_hash({ method: 'GET', path: '/path/1', generators: { 'path' => { 'type' => 'ProviderState', 'expre...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/world_spec.rb
spec/lib/pact/provider/world_spec.rb
require 'spec_helper' load 'pact/provider/world.rb' describe Pact do describe ".provider_world" do it "returns a world" do expect(Pact.provider_world).to be_instance_of Pact::Provider::World end it "returns the same world each time" do expect(Pact.provider_world).to be Pact.provider_world ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/pact_uri_spec.rb
spec/lib/pact/provider/pact_uri_spec.rb
describe Pact::Provider::PactURI do let(:uri) { 'http://uri' } let(:username) { 'pact' } let(:options) { { username: username } } let(:pact_uri) { Pact::Provider::PactURI.new(uri, options) } describe '#==' do it 'should return false if object is not PactURI' do expect(pact_uri == Object.new).to be ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/rspec/formatter_rspec_3_spec.rb
spec/lib/pact/provider/rspec/formatter_rspec_3_spec.rb
require 'spec_helper' require 'pact/provider/rspec/formatter_rspec_3' require './spec/support/factories' require './spec/support/spec_support' require 'pact/tasks/task_helper' Pact::RSpec.with_rspec_3 do module Pact module Provider module RSpec describe Formatter do let(:interaction) { I...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/rspec/calculate_exit_code_spec.rb
spec/lib/pact/provider/rspec/calculate_exit_code_spec.rb
require 'pact/provider/rspec/calculate_exit_code' module Pact module Provider module RSpec module CalculateExitCode describe ".call" do let(:pact_source_1) { double('pact_source_1', pending?: pending_1) } let(:pending_1) { nil } let(:pact_source_2) { double('pact_sourc...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/rspec/formatter_rspec_2_spec.rb
spec/lib/pact/provider/rspec/formatter_rspec_2_spec.rb
require 'spec_helper' require 'pact/provider/rspec/formatter_rspec_2' require './spec/support/factories' require './spec/support/spec_support' require 'pact/tasks/task_helper' module Pact module Provider module RSpec describe Formatter2 do Pact::RSpec.with_rspec_3 do # These methods don'...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/verification_results/create_spec.rb
spec/lib/pact/provider/verification_results/create_spec.rb
require 'pact/provider/verification_results/create' module Pact module Provider module VerificationResults describe Create do before do allow(Pact.configuration).to receive(:provider).and_return(provider_configuration) allow(VerificationResult).to receive(:new).and_return(verifi...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/verification_results/publish_spec.rb
spec/lib/pact/provider/verification_results/publish_spec.rb
require 'pact/provider/verification_results/publish' module Pact module Provider module VerificationResults describe Publish do describe "call" do let(:publish_verification_url) { nil } let(:stubbed_publish_verification_url) { 'http://broker/something/provider/Bar/verifications'...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/state/provider_state_manager_spec.rb
spec/lib/pact/provider/state/provider_state_manager_spec.rb
require 'spec_helper' require 'pact/provider/state/provider_state_manager' module Pact::Provider::State describe ProviderStateManager do PROVIDER_STATE_MESSAGES = [] before do PROVIDER_STATE_MESSAGES.clear Pact.clear_provider_world Pact.set_up do PROVIDER_STATE_MESSAGES << :globa...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/state/provider_state_spec.rb
spec/lib/pact/provider/state/provider_state_spec.rb
require 'spec_helper' require 'pact/provider/state/provider_state' module Pact module Provider::State describe ProviderStates do module ProviderStatesHelper def help_me_set_up "set up helped" end def help_me_tear_down "tear down helped" end end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/state/provider_state_proxy_spec.rb
spec/lib/pact/provider/state/provider_state_proxy_spec.rb
require 'spec_helper' require 'pact/provider/state/provider_state_proxy' module Pact module Provider::State describe ProviderStateProxy do let(:provider_state_proxy) { ProviderStateProxy.new } let(:options) { { for: 'some consumer' } } let(:provider_state) { double("provider_state") } ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/help/console_text_spec.rb
spec/lib/pact/provider/help/console_text_spec.rb
require 'spec_helper' require 'pact/provider/help/console_text' require 'fileutils' module Pact module Provider module Help describe ConsoleText do describe ".call" do let(:help_path) { File.join(reports_dir, Write::HELP_FILE_NAME) } let(:reports_dir) { "./tmp/reports/pacts" } ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/help/content_spec.rb
spec/lib/pact/provider/help/content_spec.rb
require 'pact/provider/help/content' module Pact module Provider module Help describe Content do describe "#text" do before do allow(PactDiff).to receive(:call).with(pact_source_1).and_return('diff 1') allow(PactDiff).to receive(:call).with(pact_source_2).and_retur...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/help/prompt_text_spec.rb
spec/lib/pact/provider/help/prompt_text_spec.rb
require 'spec_helper' require 'pact/provider/help/prompt_text' module Pact module Provider module Help describe PromptText do describe ".call" do let(:reports_dir){ File.expand_path "./reports/pacts" } let(:color) { false } subject { PromptText.(reports_dir, color: co...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/help/write_spec.rb
spec/lib/pact/provider/help/write_spec.rb
require 'pact/provider/help/write' module Pact module Provider module Help describe Write do describe "#call" do let(:pact_sources) { double('pact jsons') } let(:reports_dir) { "./tmp/reports" } let(:text) { "help text" } before do FileUtils.rm...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/pact_verification_spec.rb
spec/lib/pact/provider/configuration/pact_verification_spec.rb
require 'spec_helper' require 'pact/provider/configuration/pact_verification' module Pact module Provider module Configuration describe PactVerification do describe 'create_verification' do let(:url) { 'http://some/uri' } let(:pact_repository_uri_options) do { ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb
spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb
require "spec_helper" require "pact/provider/configuration/service_provider_dsl" require "pact/provider/pact_uri" require "pact/pact_broker/fetch_pacts" module Pact module Provider module Configuration describe MessageProviderDSL do describe "initialize" do context "with an object instead...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/service_provider_dsl_spec.rb
spec/lib/pact/provider/configuration/service_provider_dsl_spec.rb
require 'spec_helper' require 'pact/provider/configuration/service_provider_dsl' require 'pact/provider/pact_uri' require 'pact/pact_broker/fetch_pacts' module Pact module Provider module Configuration describe ServiceProviderDSL do describe "initialize" do context "with an object in...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/pact_verification_from_broker_spec.rb
spec/lib/pact/provider/configuration/pact_verification_from_broker_spec.rb
require 'pact/provider/configuration/pact_verification' module Pact module Provider module Configuration describe PactVerificationFromBroker do describe 'build' do let(:provider_name) {'provider-name'} let(:provider_version_branch) { 'main' } let(:provider_version_tags...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/configuration_extension_spec.rb
spec/lib/pact/provider/configuration/configuration_extension_spec.rb
require 'spec_helper' require 'pact/provider/configuration/configuration_extension' module Pact module Provider module Configuration describe ConfigurationExtension do subject { Object.new.extend(ConfigurationExtension) } it 'replays interactions in the recorded order by default' do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/configuration/service_provider_config_spec.rb
spec/lib/pact/provider/configuration/service_provider_config_spec.rb
require 'pact/provider/configuration/service_provider_config' module Pact module Provider module Configuration describe ServiceProviderConfig do describe "app" do let(:app_block) { ->{ Object.new } } subject { ServiceProviderConfig.new("1.2.3'", "main", [], true, 'http://ci/bu...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/provider/matchers/messages_spec.rb
spec/lib/pact/provider/matchers/messages_spec.rb
require 'spec_helper' require 'pact/provider/matchers/messages' module Pact module Matchers describe Messages do include Messages describe "#match_term_failure_message" do let(:diff_formatter) { Pact::Matchers::UnixDiffFormatter } let(:message) { "line1\nline2"} let(:output...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/cli/spec_criteria_spec.rb
spec/lib/pact/cli/spec_criteria_spec.rb
require 'pact/cli/spec_criteria' module Pact module Cli describe SpecCriteria do describe "#spec_criteria" do let(:env_description) { "pact description set in ENV"} let(:env_provider_state) { "provider state set in ENV"} let(:env_pact_broker_interaction_id) { "interaction id set in...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/doc/interaction_view_model_spec.rb
spec/lib/pact/doc/interaction_view_model_spec.rb
require 'spec_helper' require 'pact/doc/interaction_view_model' module Pact module Doc describe InteractionViewModel do let(:consumer_contract) { Pact::ConsumerContract.from_uri './spec/support/interaction_view_model.json' } let(:interaction_with_request_with_body_and_headers) { consumer_contract.f...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/doc/generator_spec.rb
spec/lib/pact/doc/generator_spec.rb
require 'spec_helper' require 'pact/doc/generator' require 'fileutils' module Pact module Doc describe Generator do let(:doc_dir) { './tmp/doc' } let(:pact_dir) { './tmp/pacts' } let(:file_name) { "Some Consumer - Some Provider#{file_extension}" } let(:consumer_contract_renderer) { doubl...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb
spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb
require 'spec_helper' require 'pact/doc/markdown/consumer_contract_renderer' module Pact module Doc module Markdown describe ConsumerContractRenderer do subject { ConsumerContractRenderer.new(consumer_contract) } let(:consumer_contract) { Pact::ConsumerContract.from_uri './spec/support/mar...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/doc/markdown/index_renderer_spec.rb
spec/lib/pact/doc/markdown/index_renderer_spec.rb
require 'spec_helper' require 'pact/doc/markdown/index_renderer' module Pact module Doc module Markdown describe IndexRenderer do let(:consumer_name) { "Some Consumer" } let(:docs) { {"Some Provider" => "Some Provider.md", "Some other provider" => "Some other provider.md"} } let(:...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/consumer/service_consumer_spec.rb
spec/lib/pact/consumer/service_consumer_spec.rb
require 'spec_helper' module Pact describe ServiceConsumer do describe "as_json" do it "returns a hash representation of the object" do expect(ServiceConsumer.new(:name => "Bob").as_json).to eq :name => "Bob" end end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/consumer/configuration_spec.rb
spec/lib/pact/consumer/configuration_spec.rb
require 'spec_helper' require 'pact/consumer/configuration' module Pact::Consumer::Configuration describe MockService do let(:world) { Pact::Consumer::World.new } let(:port_number) { 8888 } before do Pact.clear_configuration allow(Pact::MockService::AppManager.instance).to receive(:register...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/consumer/interaction_builder_spec.rb
spec/lib/pact/consumer/interaction_builder_spec.rb
require 'spec_helper' require 'pact/consumer/interaction_builder' module Pact module Consumer describe InteractionBuilder do subject { InteractionBuilder.new {|interaction|} } let(:interaction) { double('Interaction').as_null_object} before do expect(Interaction).to receive(:new).and_...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/lib/pact/consumer/consumer_contract_builder_spec.rb
spec/lib/pact/consumer/consumer_contract_builder_spec.rb
require 'spec_helper' require 'fileutils' require 'pathname' module Pact module Consumer describe ConsumerContractBuilder do let(:consumer_name) { 'a consumer' } let(:provider_name) { 'a provider' } let(:pact_dir) { './spec/pacts' } subject do Pact::Consumer::ConsumerContractBui...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/standalone/consumer_pass_test.rb
spec/standalone/consumer_pass_test.rb
require 'pact/consumer/rspec' require './spec/support/active_support_if_configured' Pact.service_consumer "Standalone Consumer" do has_pact_with "Standalone Provider" do mock_service :standalone_service do port 1237 end end end class StandaloneClient def initialize base_url @base_url = base_u...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/spec/standalone/consumer_fail_test.rb
spec/standalone/consumer_fail_test.rb
require 'pact/consumer/rspec' require './spec/support/active_support_if_configured' Pact.service_consumer "Standalone Consumer" do has_pact_with "Standalone Provider" do mock_service :standalone_service do port 1238 end end end class StandaloneClient def initialize base_url @base_url = base_u...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app-v2/spec/rails_helper.rb
example/zoo-app-v2/spec/rails_helper.rb
require "combustion" begin Combustion.initialize! :action_controller do config.log_level = :fatal if ENV["LOG"].to_s.empty? config.i18n.available_locales = %i[en] config.i18n.default_locale = :en end rescue => e # Fail fast if application couldn't be loaded warn "💥 Failed to load the app: #{e.mes...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app-v2/spec/pact/providers/animal_service/animal_service_client_spec.rb
example/zoo-app-v2/spec/pact/providers/animal_service/animal_service_client_spec.rb
require 'pact/v2/rspec' require 'zoo_app/animal_service_client' RSpec.describe 'ZooApp::AnimalServiceClient', :pact_v2 do has_http_pact_between 'Zoo App', 'Animal Service', opts: { pact_specification: 'V4' } subject { ZooApp::AnimalServiceClient } let(:alligator_name) { 'Mary' } let(:alligator_body) { { name...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app-v2/lib/zoo_app/version.rb
example/zoo-app-v2/lib/zoo_app/version.rb
module ZooApp VERSION = '1.0.0' end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app-v2/lib/zoo_app/animal_service_client.rb
example/zoo-app-v2/lib/zoo_app/animal_service_client.rb
require 'httparty' require 'zoo_app/models/alligator' module ZooApp class AnimalServiceClient include HTTParty base_uri 'animal-service.com' def self.find_alligator_by_name name response = get("/alligators/#{name}", :headers => {'Accept' => 'application/json'}) when_successful(response) do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app-v2/lib/zoo_app/models/alligator.rb
example/zoo-app-v2/lib/zoo_app/models/alligator.rb
module ZooApp module Animals class Alligator attr_reader :name def initialize attributes @name = attributes[:name] end def == other other.is_a?(Alligator) && other.name == self.name end end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service/spec/service_consumers/pact_helper.rb
example/animal-service/spec/service_consumers/pact_helper.rb
require 'pact/provider/rspec' require "./spec/service_consumers/provider_states_for_zoo_app" Pact.service_provider 'Animal Service' do honours_pact_with "Zoo App" do pact_uri '../zoo-app/spec/pacts/zoo_app-animal_service.json' end ## For pact contracts from a Pact Broker # honours_pacts_from_pact_broke...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service/spec/service_consumers/provider_states_for_zoo_app.rb
example/animal-service/spec/service_consumers/provider_states_for_zoo_app.rb
require 'sequel' require 'animal_service/db' require 'animal_service/animal_repository' Pact.provider_states_for "Zoo App" do set_up do AnimalService::DATABASE[:animals].truncate end provider_state "there is an alligator named Mary" do set_up do AnimalService::DATABASE[:animals].insert(name: 'Mar...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service/lib/animal_service/db.rb
example/animal-service/lib/animal_service/db.rb
require 'sequel' module AnimalService DATABASE ||= Sequel.connect(adapter: 'sqlite', database: './db/animal_db.sqlite3') end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service/lib/animal_service/animal_repository.rb
example/animal-service/lib/animal_service/animal_repository.rb
require 'sequel' require_relative 'db' module AnimalService class AnimalRepository def self.find_alligator_by_name name DATABASE[:animals].where(name: name).single_record end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service/lib/animal_service/api.rb
example/animal-service/lib/animal_service/api.rb
require 'sinatra/base' require_relative 'animal_repository' require 'json' module AnimalService class Api < Sinatra::Base set :raise_errors, false set :show_exceptions, false error do e = env['sinatra.error'] content_type :json, :charset => 'utf-8' status 500 {error: e.message,...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service-v2/spec/rails_helper.rb
example/animal-service-v2/spec/rails_helper.rb
# frozen_string_literal: true require "combustion" begin Combustion.initialize! :action_controller do config.log_level = :fatal if ENV["LOG"].to_s.empty? end rescue => e # Fail fast if application couldn't be loaded warn "💥 Failed to load the app: #{e.message}\n#{e.backtrace.join("\n")}" exit(1) end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service-v2/spec/pact/consumers/http_spec.rb
example/animal-service-v2/spec/pact/consumers/http_spec.rb
# frozen_string_literal: true require 'pact/v2/rspec' require 'sequel' require 'animal_service/api' require 'animal_service/db' require 'animal_service/animal_repository' require 'rspec/mocks' include RSpec::Mocks::ExampleMethods RSpec.describe 'Verify consumers for Bar Provider', :pact_v2 do http_pact_provider 'An...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service-v2/lib/animal_service/db.rb
example/animal-service-v2/lib/animal_service/db.rb
require 'sequel' module AnimalService DATABASE ||= Sequel.connect(adapter: 'sqlite', database: './db/animal_db.sqlite3') end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false