Skip to content

Commit

Permalink
[core] Merge pull request rspec/rspec-core#2732 from rspec/fix-return…
Browse files Browse the repository at this point in the history
…-status-for-bisect

Fix bug with bisect and custom error codes

---
This commit was imported from rspec/rspec-core@fa04fdb.
  • Loading branch information
JonRowe committed Jun 5, 2020
1 parent 2926e47 commit 5d88f2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rspec-core/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 rspec-core/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 5d88f2c

Please sign in to comment.