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]