diff --git a/spec/mock_service_with_merge_spec.rb b/spec/mock_service_with_merge_spec.rb index a6a0a37..34d8529 100644 --- a/spec/mock_service_with_merge_spec.rb +++ b/spec/mock_service_with_merge_spec.rb @@ -15,7 +15,7 @@ def logger.debug *args; end end let(:mock_service_options) do - { cli_args: ['--pact-file-write-mode', 'merge'] } + { cli_args: ['--pact-file-write-mode', 'merge', '--monkeypatch', File.absolute_path('spec/support/monkeypatch.rb')] } end let(:first_interaction) do diff --git a/spec/support/monkeypatch.rb b/spec/support/monkeypatch.rb new file mode 100644 index 0000000..4a12f2f --- /dev/null +++ b/spec/support/monkeypatch.rb @@ -0,0 +1,6 @@ +def Filelock(lockname, options = {}, &block) + puts "Opening file without filelock" + File.open(lockname, File::RDWR|File::CREAT, 0644) do |file| + Timeout::timeout(options.fetch(:timeout, 60), Filelock::ExecTimeout) { yield file } + end +end