File tree 2 files changed +47
-0
lines changed
2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1
1
require 'pact/pact_broker/fetch_pacts'
2
2
require 'pact/pact_broker/fetch_wip_pacts'
3
3
4
+ #
5
+ # @public Use by Pact Provider Verifier
6
+ #
4
7
module Pact
5
8
module PactBroker
6
9
extend self
Original file line number Diff line number Diff line change
1
+ require 'pact/pact_broker'
2
+ require 'pact/provider/pact_uri'
3
+
4
+ module Pact
5
+ module PactBroker
6
+ describe ".fetch_pact_uris" do
7
+ before do
8
+ allow ( Pact ::PactBroker ::FetchPacts ) . to receive ( :call ) . and_return ( [ pact_uri ] )
9
+ end
10
+
11
+ let ( :pact_uri ) { Pact ::Provider ::PactURI . new ( "http://pact" ) }
12
+
13
+ subject { Pact ::PactBroker . fetch_pact_uris ( "foo" ) }
14
+
15
+ it "calls Pact::PactBroker::FetchPacts" do
16
+ expect ( Pact ::PactBroker ::FetchPacts ) . to receive ( :call ) . with ( "foo" )
17
+ subject
18
+ end
19
+
20
+ it "returns a list of string URLs" do
21
+ expect ( subject ) . to eq [ "http://pact" ]
22
+ end
23
+ end
24
+
25
+ describe ".fetch_wip_pact_uris" do
26
+ before do
27
+ allow ( Pact ::PactBroker ::FetchWipPacts ) . to receive ( :call ) . and_return ( [ pact_uri ] )
28
+ end
29
+
30
+ let ( :pact_uri ) { Pact ::Provider ::PactURI . new ( "http://pact" ) }
31
+
32
+ subject { Pact ::PactBroker . fetch_wip_pact_uris ( "foo" ) }
33
+
34
+ it "calls Pact::PactBroker::FetchWipPacts" do
35
+ expect ( Pact ::PactBroker ::FetchWipPacts ) . to receive ( :call ) . with ( "foo" )
36
+ subject
37
+ end
38
+
39
+ it "returns a list of string URLs" do
40
+ expect ( subject ) . to eq [ "http://pact" ]
41
+ end
42
+ end
43
+ end
44
+ end
You can’t perform that action at this time.
0 commit comments