|
1 | 1 | require 'fileutils'
|
2 | 2 | require 'support/integration_spec_support'
|
3 | 3 |
|
4 |
| -describe "The pact-mock-service command line interface", mri_only: true do |
| 4 | +describe "The pact-mock-service command line interface", mri_only: true, skip_windows: true do |
5 | 5 |
|
6 | 6 | include Pact::IntegrationTestSupport
|
7 | 7 |
|
8 | 8 | before :all do
|
9 | 9 | clear_dirs
|
10 |
| - @pid = start_server 1234, "--pact-specification-version 3.0.0" |
| 10 | + @pid = start_server 8888, "--pact-specification-version 3.0.0" |
11 | 11 | end
|
12 | 12 |
|
13 | 13 | it "starts up and responds with mocked responses" do
|
14 |
| - response = setup_interaction 1234 |
| 14 | + response = setup_interaction 8888 |
15 | 15 | expect(response.status).to eq 200
|
16 | 16 |
|
17 |
| - response = invoke_expected_request 1234 |
| 17 | + response = invoke_expected_request 8888 |
18 | 18 | puts response.body if response.status != 200
|
19 | 19 | expect(response.status).to eq 200
|
20 | 20 | expect(response.body).to eq 'Hello world'
|
21 | 21 |
|
22 |
| - write_pact 1234 |
| 22 | + write_pact 8888 |
23 | 23 | expect(response.status).to eq 200
|
24 | 24 | end
|
25 | 25 |
|
26 | 26 | it "respects headers with underscores" do
|
27 |
| - setup_interaction_with_underscored_header 1234 |
28 |
| - response = invoke_request_with_underscored_header 1234 |
| 27 | + setup_interaction_with_underscored_header 8888 |
| 28 | + response = invoke_request_with_underscored_header 8888 |
29 | 29 | puts response.body unless response.status == 200
|
30 | 30 | expect(response.status).to eq 200
|
31 | 31 | end
|
32 | 32 |
|
33 | 33 | it "sets the X-Pact-Mock-Service-Location header" do
|
34 |
| - response = setup_interaction 1234 |
35 |
| - expect(response.headers['X-Pact-Mock-Service-Location']).to eq 'http://0.0.0.0:1234' |
| 34 | + response = setup_interaction 8888 |
| 35 | + expect(response.headers['X-Pact-Mock-Service-Location']).to eq 'http://0.0.0.0:8888' |
36 | 36 | end
|
37 | 37 |
|
38 | 38 | it "writes logs to the specified log file" do
|
39 | 39 | expect(File.exist?('tmp/integration.log')).to be true
|
40 | 40 | end
|
41 | 41 |
|
42 | 42 | it "writes the pact to the specified directory" do
|
43 |
| - clear_interactions 1234 |
44 |
| - setup_interaction 1234 |
45 |
| - invoke_expected_request 1234 |
| 43 | + clear_interactions 8888 |
| 44 | + setup_interaction 8888 |
| 45 | + invoke_expected_request 8888 |
46 | 46 | expect(File.exist?('tmp/pacts/consumer-provider.json')).to be true
|
47 | 47 | end
|
48 | 48 |
|
49 | 49 | it "sets the pact specification version" do
|
50 |
| - clear_interactions 1234 |
51 |
| - setup_interaction 1234 |
52 |
| - invoke_expected_request 1234 |
| 50 | + clear_interactions 8888 |
| 51 | + setup_interaction 8888 |
| 52 | + invoke_expected_request 8888 |
53 | 53 |
|
54 |
| - write_pact 1234 |
| 54 | + write_pact 8888 |
55 | 55 | expect(File.read("tmp/pacts/consumer-provider.json")).to include "3.0.0"
|
56 | 56 | end
|
57 | 57 |
|
|
0 commit comments