|
13 | 13 | it "starts up and responds with mocked responses" do
|
14 | 14 | response = setup_interaction 8888
|
15 | 15 | expect(response.status).to eq 200
|
| 16 | + expect(response.headers['X-Pact-Mock-Service-Location']).to eq 'http://0.0.0.0:8888' |
16 | 17 |
|
17 | 18 | response = invoke_expected_request 8888
|
18 | 19 | puts response.body if response.status != 200
|
|
21 | 22 |
|
22 | 23 | write_pact 8888
|
23 | 24 | expect(response.status).to eq 200
|
24 |
| - end |
25 | 25 |
|
26 |
| - it "respects headers with underscores" do |
27 | 26 | setup_interaction_with_underscored_header 8888
|
28 | 27 | response = invoke_request_with_underscored_header 8888
|
29 | 28 | puts response.body unless response.status == 200
|
30 | 29 | expect(response.status).to eq 200
|
31 |
| - end |
32 | 30 |
|
33 |
| - it "sets the X-Pact-Mock-Service-Location header" do |
34 |
| - response = setup_interaction 8888 |
35 |
| - expect(response.headers['X-Pact-Mock-Service-Location']).to eq 'http://0.0.0.0:8888' |
| 31 | + Process.kill "INT", @pid |
| 32 | + sleep 1 # Naughty, but so much less code |
| 33 | + @pid = nil |
36 | 34 | end
|
37 | 35 |
|
38 | 36 | it "writes logs to the specified log file" do
|
39 | 37 | expect(File.exist?('tmp/integration.log')).to be true
|
40 | 38 | end
|
41 | 39 |
|
42 | 40 | it "writes the pact to the specified directory" do
|
43 |
| - clear_interactions 8888 |
44 |
| - setup_interaction 8888 |
45 |
| - invoke_expected_request 8888 |
46 | 41 | expect(File.exist?('tmp/pacts/consumer-provider.json')).to be true
|
47 | 42 | end
|
48 | 43 |
|
49 | 44 | it "sets the pact specification version" do
|
50 |
| - clear_interactions 8888 |
51 |
| - setup_interaction 8888 |
52 |
| - invoke_expected_request 8888 |
53 |
| - |
54 |
| - write_pact 8888 |
55 | 45 | expect(File.read("tmp/pacts/consumer-provider.json")).to include "3.0.0"
|
56 | 46 | end
|
57 | 47 |
|
|
0 commit comments