Skip to content

Commit

Permalink
fix: print notices from 'pacts for verification' response to indicate…
Browse files Browse the repository at this point in the history
… why pacts are included an/or pending
  • Loading branch information
bethesque committed Jan 20, 2020
1 parent bb793e7 commit b107348
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/pact/provider/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ def app
end

module ClassMethods
EMPTY_ARRAY = [].freeze

include ::RSpec::Core::DSL

def honour_pactfile pact_uri, pact_json, options
Pact.configuration.output_stream.puts "INFO: Reading pact at #{pact_uri}"
Pact.configuration.output_stream.puts("DEBUG: #{pact_uri.metadata[:inclusion_reason]}") if pact_uri.metadata[:inclusion_reason]
Pact.configuration.output_stream.puts("DEBUG: #{pact_uri.metadata[:pending_reason]}") if pact_uri.metadata[:pending_reason]
(pact_uri.metadata[:notices] || EMPTY_ARRAY).each do | notice |
Pact.configuration.output_stream.puts("DEBUG: #{notice}")
end
Pact.configuration.output_stream.puts "DEBUG: Filtering interactions by: #{options[:criteria]}" if options[:criteria] && options[:criteria].any?
consumer_contract = Pact::ConsumerContract.from_json(pact_json)
suffix = pact_uri.metadata[:pending] ? " [PENDING]": ""
Expand Down

0 comments on commit b107348

Please sign in to comment.