Has anyone run into issues having both `service_pr...
# pact-ruby
c
Has anyone run into issues having both
service_provider
and
message_provider
in the same
pact_helper.rb
file? The solution I'm about to try is just changing the name of the message provider to
super_secret_name_for_slack_message
, and I expect that to work. It would be ideal though, if we didn't need to have two different names for the provider service depending on which type of Pact we're expecting.
Copy code
Pact.service_provider "super_secret_name_for_slack" do
  honours_pacts_from_pact_broker do
    pact_broker_base_url pact_base_url, {token: token}
    consumer_version_selectors [version_selector]
  end

  app_version provider_version
  app_version_tags [provider_branch]
  app_version_branch provider_branch
  publish_verification_results publish_flag
end

Pact.message_provider "super_secret_name_for_slack" do
  honours_pacts_from_pact_broker do
    pact_broker_base_url pact_base_url, {token: token}
    consumer_version_selectors [version_selector]
  end

  app_version provider_version
  app_version_tags [provider_branch]
  publish_verification_results publish_flag

  builder do |message_description|
    DatabaseCleaner.clean
    CONFIG[message_description].call
  end
end
plusone 1651 1
@Ben Docherty
I've been able to create a new rake task which points to a new pact_helper file specifically for messages:
contract_tests.rake
Copy code
desc "Provider Contracts Message Verification"
Pact::VerificationTask.new(:messages) do |task|
  task.pact_helper './spec/contract/service_consumers/pact_helper_message'
end