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

Commit 6dc1e1a

Browse files
Clearer terminology in run-counting specs
1 parent 17802c2 commit 6dc1e1a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

spec/rspec/core/bisect/example_minimizer_spec.rb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,24 @@ module RSpec::Core
5050
)
5151
end
5252

53-
context 'with an unminimisable run' do
54-
class RoundCountingReporter < RSpec::Core::NullReporter
53+
context 'with an unminimisable failure' do
54+
class RunCountingReporter < RSpec::Core::NullReporter
5555
attr_accessor :round_count
56+
attr_accessor :example_count
57+
def initialize
58+
@round_count = 0
59+
end
5660

57-
def publish(event, *_args)
58-
public_send(event) if respond_to? event
61+
def publish(event, *args)
62+
public_send(event, *args) if respond_to? event
5963
end
6064

61-
def bisect_individual_run_start
62-
self.round_count ||= 0
65+
def bisect_individual_run_start(_notification)
6366
self.round_count += 1
6467
end
6568
end
6669

67-
let(:counting_reporter) { RoundCountingReporter.new }
70+
let(:counting_reporter) { RunCountingReporter.new }
6871
let(:fake_runner) do
6972
FakeBisectRunner.new(
7073
%w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ex_9 ],
@@ -74,15 +77,15 @@ def bisect_individual_run_start
7477
end
7578
let(:minimizer) { Bisect::ExampleMinimizer.new(fake_runner, counting_reporter) }
7679

77-
it 'returns the full command if the run can not be reduced' do
80+
it 'returns the full command if the failure can not be reduced' do
7881
minimizer.find_minimal_repro
7982

8083
expect(minimizer.repro_command_for_currently_needed_ids).to eq(
8184
"rspec ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ex_9"
8285
)
8386
end
8487

85-
it 'detects an unminimisable run in the minimum number of rounds' do
88+
it 'detects an unminimisable failure in the minimum number of runs' do
8689
minimizer.find_minimal_repro
8790

8891
expect(counting_reporter.round_count).to eq(15)

0 commit comments

Comments
 (0)