Skip to content

Commit

Permalink
chore: support old --ignore-failures as well as new pending
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 26, 2020
1 parent 533faa1 commit b8101f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion lib/pact/provider/pact_spec_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ def run_specs
.run(::RSpec.configuration.output_stream, ::RSpec.configuration.error_stream)
end

Pact::Provider::RSpec::CalculateExitCode.call(pact_sources, Pact.provider_world.failed_examples)
if options[:ignore_failures]
0
else
Pact::Provider::RSpec::CalculateExitCode.call(pact_sources, Pact.provider_world.failed_examples)
end
end

def rspec_runner_options
Expand Down
2 changes: 1 addition & 1 deletion lib/pact/provider/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def describe_interaction interaction, options
pact_interaction_example_description: interaction_description_for_rerun_command(interaction),
pact_uri: options[:pact_uri],
pact_source: options[:pact_source],
pact_ignore_failures: options[:pact_uri].metadata[:pending] || options[:ignore_failures],
pact_ignore_failures: options[:pact_source].pending? || options[:ignore_failures],
pact_consumer_contract: options[:consumer_contract],
pact_criteria: options[:criteria]
}
Expand Down
4 changes: 0 additions & 4 deletions lib/pact/provider/rspec/formatter_rspec_3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ def pending_interactions_count(summary)
pending_interaction_examples(summary).size
end

def ignore_failures?(summary)
summary.failed_examples.any?{ |e| e.metadata[:pact_ignore_failures] }
end

def failure_title summary
::RSpec::Core::Formatters::Helpers.pluralize(failed_interactions_count(summary), "failure")
end
Expand Down

0 comments on commit b8101f1

Please sign in to comment.