@@ -14,21 +14,25 @@ module VerificationResults
1414 double ( 'provider_configuration' , application_version : '1.2.3' )
1515 end
1616 let ( :pact_source_1 ) do
17- instance_double ( 'Pact::Provider::PactSource' , uri : pact_uri_1 , pact_hash : pact_hash_1 )
17+ instance_double ( 'Pact::Provider::PactSource' , uri : pact_uri_1 , consumer_contract : consumer_contract )
1818 end
19+ let ( :consumer_contract ) { instance_double ( 'Pact::ConsumerContract' , interactions : interactions ) }
20+ let ( :interactions ) { [ interaction_1 ] }
21+ let ( :interaction_1 ) { instance_double ( 'Pact::Interaction' , _id : "1" ) }
22+ let ( :interaction_2 ) { instance_double ( 'Pact::Interaction' , _id : "2" ) }
1923 let ( :pact_uri_1 ) { instance_double ( 'Pact::Provider::PactURI' , uri : URI ( 'foo' ) ) }
2024 let ( :pact_uri_2 ) { instance_double ( 'Pact::Provider::PactURI' , uri : URI ( 'bar' ) ) }
2125 let ( :example_1 ) do
2226 {
2327 pact_uri : pact_uri_1 ,
24- pact_interaction : double ( 'interaction' ) ,
28+ pact_interaction : interaction_1 ,
2529 status : 'passed'
2630 }
2731 end
2832 let ( :example_2 ) do
2933 {
3034 pact_uri : pact_uri_2 ,
31- pact_interaction : double ( 'interaction' ) ,
35+ pact_interaction : interaction_2 ,
3236 status : 'passed'
3337 }
3438 end
@@ -37,11 +41,6 @@ module VerificationResults
3741 tests : [ example_1 , example_2 ]
3842 }
3943 end
40- let ( :pact_hash_1 ) do
41- {
42- 'interactions' => [ { } ]
43- }
44- end
4544
4645 subject { Create . call ( pact_source_1 , test_results_hash ) }
4746
@@ -78,11 +77,9 @@ module VerificationResults
7877 end
7978
8079 context "when not every interaction has been executed" do
81- let ( :pact_hash_1 ) do
82- {
83- 'interactions' => [ { } , { } ]
84- }
85- end
80+ let ( :interaction_3 ) { instance_double ( 'Pact::Interaction' , _id : "3" ) }
81+ let ( :interactions ) { [ interaction_1 , interaction_2 ] }
82+
8683 it "sets publishable to false" do
8784 expect ( VerificationResult ) . to receive ( :new ) . with ( false , anything , anything , anything )
8885 subject
0 commit comments