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

Commit 9007b0e

Browse files
Add bisection test case for reducing independent failures
1 parent 37d224e commit 9007b0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/rspec/core/bisect/example_minimizer_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ module RSpec::Core
1919
expect(minimizer.repro_command_for_currently_needed_ids).to eq("rspec ex_2 ex_4 ex_5")
2020
end
2121

22+
it 'reduces a failure where none of the passing examples are implicated' do
23+
no_dependents_runner = FakeBisectRunner.new(
24+
%w[ ex_1 ex_2 ],
25+
%w[ ex_2 ],
26+
{}
27+
)
28+
minimizer = Bisect::ExampleMinimizer.new(no_dependents_runner, RSpec::Core::NullReporter)
29+
minimizer.find_minimal_repro
30+
expect(minimizer.repro_command_for_currently_needed_ids).to eq("rspec ex_2")
31+
end
32+
2233
it 'reduces a failure when more than 50% of examples are implicated' do
2334
fake_runner.always_failures = []
2435
fake_runner.dependent_failures = { "ex_8" => %w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ] }

0 commit comments

Comments
 (0)