Skip to content

Commit 3337f6d

Browse files
committed
fix: use dummy pact specification version for stub server
1 parent b585092 commit 3337f6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/pact/mock_service/run.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'pact/consumer/mock_service/set_location'
44
require 'pact/mock_service/run'
55
require 'pact/mock_service/server/webrick_request_monkeypatch'
6+
require 'pact/specification_version'
67

78
module Pact
89
module MockService
@@ -50,14 +51,15 @@ def call_shutdown_hooks
5051
end
5152

5253
def service_options
54+
# dummy pact_specification_version is needed to stop RequestHandlers blowing up
5355
service_options = {
5456
pact_dir: options[:pact_dir],
5557
log_level: options[:log_level],
5658
unique_pact_file_names: options[:unique_pact_file_names],
5759
consumer: options[:consumer],
5860
provider: options[:provider],
5961
cors_enabled: options[:cors],
60-
pact_specification_version: options[:pact_specification_version],
62+
pact_specification_version: Pact::SpecificationVersion::NIL_VERSION.to_s,
6163
pactfile_write_mode: options[:pact_file_write_mode],
6264
stub_pactfile_paths: options[:stub_pactfile_paths]
6365
}

0 commit comments

Comments
 (0)