From 1653128540c5127eaea10237d708366b96632209 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 6 Aug 2024 23:10:10 +0100 Subject: [PATCH] feat: support app_version_branch in MessageProviderDSL fixes #259 --- lib/pact/provider/configuration/message_provider_dsl.rb | 4 ++++ .../pact/provider/configuration/message_provider_dsl_spec.rb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pact/provider/configuration/message_provider_dsl.rb b/lib/pact/provider/configuration/message_provider_dsl.rb index dc45d899..754dbf76 100644 --- a/lib/pact/provider/configuration/message_provider_dsl.rb +++ b/lib/pact/provider/configuration/message_provider_dsl.rb @@ -34,6 +34,10 @@ def app_version_tags tags self.tags = tags end + def app_version_branch branch + self.branch = branch + end + def publish_verification_results publish_verification_results self.publish_verification_results = publish_verification_results Pact::RSpec.with_rspec_2 do diff --git a/spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb b/spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb index b41f5895..87862155 100644 --- a/spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb +++ b/spec/lib/pact/provider/configuration/message_provider_dsl_spec.rb @@ -151,6 +151,7 @@ module Configuration subject do described_class.build "some-provider" do app {} + app_version_branch 'main' app_version_tags ["dev"] honours_pacts_from_pact_broker do end @@ -158,7 +159,7 @@ module Configuration end it "builds a PactVerificationFromBroker" do - expect(PactVerificationFromBroker).to receive(:build).with("some-provider", nil, ["dev"]) + expect(PactVerificationFromBroker).to receive(:build).with("some-provider", 'main', ["dev"]) subject end end