Skip to content

Commit

Permalink
fix: pass the pact specification version from the control server to t…
Browse files Browse the repository at this point in the history
…he mock server
  • Loading branch information
bethesque committed Jul 22, 2018
1 parent 3fb6e3a commit b585092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/pact/mock_service/control_server/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def control_server_options
pact_dir: options[:pact_dir] || ".",
unique_pact_file_names: options[:unique_pact_file_names],
cors_enabled: options[:cors] || false,
ssl: options[:ssl]
ssl: options[:ssl],
pact_specification_version: options[:pact_specification_version]
}
end

Expand Down
6 changes: 5 additions & 1 deletion spec/integration/control_server_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def mock_service_headers

before :all do
clear_dirs
@pid = start_control 1234
@pid = start_control 1234, "--pact-specification-version 3"
end

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

it "writes the pacts with the specified in pact specification version" do
expect(JSON.parse(File.read('tmp/pacts/consumer-provider.json'))['metadata']['pactSpecification']['version']).to eq '3.0.0'
end

after :all do
kill_server @pid
end
Expand Down

0 comments on commit b585092

Please sign in to comment.