Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix bug with bisect and custom error codes #2732

Merged
merged 1 commit into from
May 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rspec/core/invocations.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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