@@ -50,21 +50,24 @@ module RSpec::Core
50
50
)
51
51
end
52
52
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
55
55
attr_accessor :round_count
56
+ attr_accessor :example_count
57
+ def initialize
58
+ @round_count = 0
59
+ end
56
60
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
59
63
end
60
64
61
- def bisect_individual_run_start
62
- self . round_count ||= 0
65
+ def bisect_individual_run_start ( _notification )
63
66
self . round_count += 1
64
67
end
65
68
end
66
69
67
- let ( :counting_reporter ) { RoundCountingReporter . new }
70
+ let ( :counting_reporter ) { RunCountingReporter . new }
68
71
let ( :fake_runner ) do
69
72
FakeBisectRunner . new (
70
73
%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
74
77
end
75
78
let ( :minimizer ) { Bisect ::ExampleMinimizer . new ( fake_runner , counting_reporter ) }
76
79
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
78
81
minimizer . find_minimal_repro
79
82
80
83
expect ( minimizer . repro_command_for_currently_needed_ids ) . to eq (
81
84
"rspec ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ex_9"
82
85
)
83
86
end
84
87
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
86
89
minimizer . find_minimal_repro
87
90
88
91
expect ( counting_reporter . round_count ) . to eq ( 15 )
0 commit comments