From fb5488e404ac2cd3458ec9686a62d45b849ab207 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 6 Aug 2024 15:35:13 +0100 Subject: [PATCH] fix: remove unused ConsumerContractBuilder contract_details accessor --- lib/pact/consumer/consumer_contract_builder.rb | 6 +++--- .../pact/consumer/consumer_contract_builder_spec.rb | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/pact/consumer/consumer_contract_builder.rb b/lib/pact/consumer/consumer_contract_builder.rb index 17aa0908..a431c77e 100644 --- a/lib/pact/consumer/consumer_contract_builder.rb +++ b/lib/pact/consumer/consumer_contract_builder.rb @@ -11,11 +11,11 @@ class ConsumerContractBuilder include Pact::Logging - attr_reader :consumer_contract, :mock_service_base_url + attr_reader :mock_service_base_url def initialize(attributes) @interaction_builder = nil - @consumer_contract = { + @consumer_contract_details = { consumer: {name: attributes[:consumer_name]}, provider: {name: attributes[:provider_name]}, pactfile_write_mode: attributes[:pactfile_write_mode].to_s, @@ -46,7 +46,7 @@ def log msg end def write_pact - mock_service_client.write_pact @consumer_contract + mock_service_client.write_pact @consumer_contract_details end def wait_for_interactions options = {} diff --git a/spec/lib/pact/consumer/consumer_contract_builder_spec.rb b/spec/lib/pact/consumer/consumer_contract_builder_spec.rb index a61cf62f..3f35a070 100644 --- a/spec/lib/pact/consumer/consumer_contract_builder_spec.rb +++ b/spec/lib/pact/consumer/consumer_contract_builder_spec.rb @@ -63,17 +63,6 @@ module Consumer end end - describe "#consumer_contract" do - it "returns the consumer contract" do - expect(subject.consumer_contract).to eq( - consumer: { name: consumer_name }, - provider: { name: provider_name }, - pactfile_write_mode: 'overwrite', - pact_dir: pact_dir - ) - end - end - describe "#mock_service_base_url" do subject do