forked from pact-foundation/pact-mock_service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pact-stub-service): ensure all interactions loaded when loading m…
…ultiple pacts Closes: pact-foundation#83
- Loading branch information
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'support/integration_spec_support' | ||
|
||
describe "The pact-stub-service command line interface with multiple pacts", mri_only: true do | ||
|
||
include Pact::IntegrationTestSupport | ||
|
||
PORT = 5556 | ||
|
||
before :all do | ||
clear_dirs | ||
@pid = start_stub_server PORT, "spec/support/pact-for-stub-1.json spec/support/pact-for-stub-2.json" | ||
end | ||
|
||
it "includes the interactions from the first pact file" do | ||
response = Faraday.get "http://localhost:#{PORT}/path1" | ||
puts response.body if response.status != 200 | ||
expect(response.status).to eq 200 | ||
end | ||
|
||
it "includes the interactions from the second pact file" do | ||
response = Faraday.get "http://localhost:#{PORT}/path2" | ||
puts response.body if response.status != 200 | ||
expect(response.status).to eq 200 | ||
end | ||
|
||
after :all do | ||
kill_server @pid | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"provider": { | ||
"name": "a provider" | ||
}, | ||
"consumer": { | ||
"name": "a consumer" | ||
}, | ||
"interactions": [ | ||
{ | ||
"description": "request one", | ||
"request": { | ||
"method": "get", | ||
"path": "/path1" | ||
}, | ||
"response": { | ||
"status": 200 | ||
}, | ||
"providerState": "state one" | ||
} | ||
], | ||
"metadata": { | ||
"pactSpecification": { | ||
"version": "2.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"provider": { | ||
"name": "a provider" | ||
}, | ||
"consumer": { | ||
"name": "a consumer" | ||
}, | ||
"interactions": [ | ||
{ | ||
"description": "request two", | ||
"request": { | ||
"method": "get", | ||
"path": "/path2" | ||
}, | ||
"response": { | ||
"status": 200 | ||
}, | ||
"providerState": "state two" | ||
} | ||
], | ||
"metadata": { | ||
"pactSpecification": { | ||
"version": "2.0" | ||
} | ||
} | ||
} |