Skip to content

Commit

Permalink
Merge pull request rspec#2732 from rspec/fix-return-status-for-bisect
Browse files Browse the repository at this point in the history
Fix bug with bisect and custom error codes
  • Loading branch information
JonRowe committed May 30, 2020
2 parents 10a77ee + 3d69cb8 commit 8feb454
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/core/invocations.rb
Expand Up @@ -37,7 +37,7 @@ def call(options, err, out)
runner, options.args, formatter
)

success ? 0 : 1
success ? 0 : runner.configuration.failure_exit_code
end

private
Expand Down
10 changes: 10 additions & 0 deletions spec/rspec/core/invocations_spec.rb
Expand Up @@ -111,6 +111,16 @@ def run_invocation

expect(exit_code).to eq(1)
end

context "with a custom failure code set" do
it "returns the custom failure code" do
in_sub_process do
RSpec.configuration.failure_exit_code = 42
exit_code = run_invocation
expect(exit_code).to eq(42)
end
end
end
end

context "and the verbose option is specified" do
Expand Down

0 comments on commit 8feb454

Please sign in to comment.