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

Commit fa04fdb

Browse files
committed
Merge pull request #2732 from rspec/fix-return-status-for-bisect
Fix bug with bisect and custom error codes
1 parent 9d8149c commit fa04fdb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/rspec/core/invocations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def call(options, err, out)
3737
runner, options.args, formatter
3838
)
3939

40-
success ? 0 : 1
40+
success ? 0 : runner.configuration.failure_exit_code
4141
end
4242

4343
private

spec/rspec/core/invocations_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ def run_invocation
111111

112112
expect(exit_code).to eq(1)
113113
end
114+
115+
context "with a custom failure code set" do
116+
it "returns the custom failure code" do
117+
in_sub_process do
118+
RSpec.configuration.failure_exit_code = 42
119+
exit_code = run_invocation
120+
expect(exit_code).to eq(42)
121+
end
122+
end
123+
end
114124
end
115125

116126
context "and the verbose option is specified" do

0 commit comments

Comments
 (0)