diff --git a/lib/pact/provider/pact_spec_runner.rb b/lib/pact/provider/pact_spec_runner.rb index 7db51560..5e4c9b68 100644 --- a/lib/pact/provider/pact_spec_runner.rb +++ b/lib/pact/provider/pact_spec_runner.rb @@ -91,7 +91,7 @@ def run_specs ::RSpec::Core::CommandLine.new(NoConfigurationOptions.new) .run(::RSpec.configuration.output_stream, ::RSpec.configuration.error_stream) end - options[:ignore_failures] ? 0 : exit_code + (all_pacts_pending? || options[:ignore_failures]) ? 0 : exit_code end def rspec_runner_options @@ -159,6 +159,10 @@ def ordered_pact_json(pact_json) consumer_contract.to_json end + def all_pacts_pending? + pact_urls.all?{ | pact_url| pact_url.metadata[:pending] } + end + def class_exists? name Kernel.const_get name rescue NameError diff --git a/lib/pact/provider/rspec.rb b/lib/pact/provider/rspec.rb index 61dfed0d..1a7f2a65 100644 --- a/lib/pact/provider/rspec.rb +++ b/lib/pact/provider/rspec.rb @@ -76,7 +76,7 @@ def describe_interaction interaction, options pact_interaction: interaction, pact_interaction_example_description: interaction_description_for_rerun_command(interaction), pact_uri: options[:pact_uri], - pact_ignore_failures: options[:pact_uri].metadata[:pending] + pact_ignore_failures: options[:pact_uri].metadata[:pending] || options[:ignore_failures] } describe description_for(interaction), metadata do