Skip to content

Commit c805c3e

Browse files
committed
fix: ConsumerContractBuilder exposing incorrect field
1 parent 094e0fe commit c805c3e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/pact/consumer/consumer_contract_builder.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ConsumerContractBuilder
1515

1616
def initialize(attributes)
1717
@interaction_builder = nil
18-
@consumer_contract_details = {
18+
@consumer_contract = {
1919
consumer: {name: attributes[:consumer_name]},
2020
provider: {name: attributes[:provider_name]},
2121
pactfile_write_mode: attributes[:pactfile_write_mode].to_s,
@@ -42,7 +42,7 @@ def log msg
4242
end
4343

4444
def write_pact
45-
mock_service_client.write_pact @consumer_contract_details
45+
mock_service_client.write_pact @consumer_contract
4646
end
4747

4848
def wait_for_interactions options = {}

spec/lib/pact/consumer/consumer_contract_builder_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ module Consumer
6262
end
6363
end
6464

65+
describe "#consumer_contract" do
66+
it "returns the consumer contract" do
67+
expect(subject.consumer_contract).to eq(
68+
consumer: { name: consumer_name },
69+
provider: { name: provider_name },
70+
pactfile_write_mode: 'overwrite',
71+
pact_dir: pact_dir
72+
)
73+
end
74+
end
75+
6576
describe "#mock_service_base_url" do
6677

6778
subject do

0 commit comments

Comments
 (0)