From 31192d06d306dbe6a8bf7f6e5097ee5de6097f23 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 13 Nov 2017 20:45:47 +1100 Subject: [PATCH] feat(publish test results): only publish for rspec 3 --- lib/pact/provider/pact_spec_runner.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pact/provider/pact_spec_runner.rb b/lib/pact/provider/pact_spec_runner.rb index 5757d030..7e1cff57 100644 --- a/lib/pact/provider/pact_spec_runner.rb +++ b/lib/pact/provider/pact_spec_runner.rb @@ -62,7 +62,9 @@ def configure_rspec config.output_stream = Pact.configuration.output_stream end - ::RSpec.configuration.add_formatter Pact::Provider::RSpec::PactBrokerFormatter, StringIO.new + Pact::RSpec.with_rspec_3 do + ::RSpec.configuration.add_formatter Pact::Provider::RSpec::PactBrokerFormatter, StringIO.new + end if options[:format] ::RSpec.configuration.add_formatter options[:format]