Skip to content

Commit b585092

Browse files
committed
fix: pass the pact specification version from the control server to the mock server
1 parent 3fb6e3a commit b585092

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/pact/mock_service/control_server/run.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def control_server_options
5454
pact_dir: options[:pact_dir] || ".",
5555
unique_pact_file_names: options[:unique_pact_file_names],
5656
cors_enabled: options[:cors] || false,
57-
ssl: options[:ssl]
57+
ssl: options[:ssl],
58+
pact_specification_version: options[:pact_specification_version]
5859
}
5960
end
6061

spec/integration/control_server_cli_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def mock_service_headers
2222

2323
before :all do
2424
clear_dirs
25-
@pid = start_control 1234
25+
@pid = start_control 1234, "--pact-specification-version 3"
2626
end
2727

2828
it "starts up and responds with mocked responses" do
@@ -49,6 +49,10 @@ def mock_service_headers
4949
expect(File.exist?('tmp/pacts/consumer-provider.json')).to be true
5050
end
5151

52+
it "writes the pacts with the specified in pact specification version" do
53+
expect(JSON.parse(File.read('tmp/pacts/consumer-provider.json'))['metadata']['pactSpecification']['version']).to eq '3.0.0'
54+
end
55+
5256
after :all do
5357
kill_server @pid
5458
end

0 commit comments

Comments
 (0)