Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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