@@ -12,38 +12,30 @@ module Formatters
12
12
# after each example.
13
13
# @private
14
14
class BisectFormatter
15
- Formatters . register self , :start , :start_dump , :example_started ,
16
- :example_failed , :example_passed , :example_pending
15
+ Formatters . register self , :start_dump , :example_failed , :example_finished
17
16
18
17
def initialize ( _output )
19
- port = RSpec . configuration . drb_port
20
- drb_uri = "druby://localhost:#{ port } "
21
- @all_example_ids = [ ]
22
- @failed_example_ids = [ ]
18
+ drb_uri = "druby://localhost:#{ RSpec . configuration . drb_port } "
23
19
@bisect_server = DRbObject . new_with_uri ( drb_uri )
24
- @remaining_failures = [ ]
25
20
RSpec . configuration . files_or_directories_to_run = @bisect_server . files_or_directories_to_run
26
- end
27
21
28
- def start ( _notification )
22
+ @all_example_ids = [ ]
23
+ @failed_example_ids = [ ]
29
24
@remaining_failures = Set . new ( @bisect_server . expected_failures )
30
25
end
31
26
32
- def example_started ( notification )
33
- @all_example_ids << notification . example . id
34
- end
35
-
36
27
def example_failed ( notification )
37
28
@failed_example_ids << notification . example . id
38
- example_finished ( notification , :failed )
39
29
end
40
30
41
- def example_passed ( notification )
42
- example_finished ( notification , :passed )
43
- end
31
+ def example_finished ( notification )
32
+ @all_example_ids << notification . example . id
33
+ return unless @remaining_failures . include? ( notification . example . id )
34
+ @remaining_failures . delete ( notification . example . id )
44
35
45
- def example_pending ( notification )
46
- example_finished ( notification , :pending )
36
+ status = notification . example . execution_result . status
37
+ return if status == :failed && !@remaining_failures . empty?
38
+ RSpec . world . wants_to_quit = true
47
39
end
48
40
49
41
def start_dump ( _notification )
@@ -53,16 +45,6 @@ def start_dump(_notification)
53
45
end
54
46
55
47
RunResults = Struct . new ( :all_example_ids , :failed_example_ids )
56
-
57
- private
58
-
59
- def example_finished ( notification , status )
60
- return unless @remaining_failures . include? ( notification . example . id )
61
- @remaining_failures . delete ( notification . example . id )
62
-
63
- return if status == :failed && !@remaining_failures . empty?
64
- RSpec . world . wants_to_quit = true
65
- end
66
48
end
67
49
end
68
50
end
0 commit comments