@@ -21,16 +21,20 @@ module ClassMethods
21
21
22
22
include ::RSpec ::Core ::DSL
23
23
24
- def honour_pactfile pact_uri , pact_json , options
24
+ def honour_pactfile pact_source , pact_json , options
25
+ pact_uri = pact_source . uri
25
26
Pact . configuration . output_stream . puts "INFO: Reading pact at #{ pact_uri } "
26
- ( pact_uri . metadata [ :notices ] || EMPTY_ARRAY ) . each do | notice |
27
- Pact . configuration . output_stream . puts ( "DEBUG: #{ notice [ :text ] } " )
27
+ if pact_uri . metadata [ :notices ]
28
+ pact_uri . metadata [ :notices ] . before_verification_notices_text . each do | text |
29
+ Pact . configuration . output_stream . puts ( "DEBUG: #{ text } " )
30
+ end
28
31
end
32
+
29
33
Pact . configuration . output_stream . puts "DEBUG: Filtering interactions by: #{ options [ :criteria ] } " if options [ :criteria ] && options [ :criteria ] . any?
30
34
consumer_contract = Pact ::ConsumerContract . from_json ( pact_json )
31
35
suffix = pact_uri . metadata [ :pending ] ? " [PENDING]" : ""
32
36
::RSpec . describe "Verifying a pact between #{ consumer_contract . consumer . name } and #{ consumer_contract . provider . name } #{ suffix } " , pactfile_uri : pact_uri do
33
- honour_consumer_contract consumer_contract , options . merge ( pact_json : pact_json , pact_uri : pact_uri )
37
+ honour_consumer_contract consumer_contract , options . merge ( pact_json : pact_json , pact_uri : pact_uri , pact_source : pact_source , consumer_contract : consumer_contract )
34
38
end
35
39
end
36
40
@@ -78,7 +82,9 @@ def describe_interaction interaction, options
78
82
pact_interaction : interaction ,
79
83
pact_interaction_example_description : interaction_description_for_rerun_command ( interaction ) ,
80
84
pact_uri : options [ :pact_uri ] ,
81
- pact_ignore_failures : options [ :pact_uri ] . metadata [ :pending ] || options [ :ignore_failures ]
85
+ pact_source : options [ :pact_source ] ,
86
+ pact_ignore_failures : options [ :pact_uri ] . metadata [ :pending ] || options [ :ignore_failures ] ,
87
+ pact_consumer_contract : options [ :consumer_contract ]
82
88
}
83
89
84
90
describe description_for ( interaction ) , metadata do
0 commit comments