File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 94
94
@notifier . stop
95
95
96
96
dir . join ( "three.txt" ) . write ( "hello world" )
97
- barriers . shift . wait ( 1 )
98
-
99
- dir . join ( "four.txt" ) . write ( "hello world" )
100
- run_thread . join
97
+ run_thread . join ( 1 ) or raise "timeout"
101
98
102
99
expect ( events . map ( &:name ) ) . to match_array ( %w( one.txt two.txt ) )
103
100
end
104
101
105
102
it "can be stopped from within a callback" do
106
- barriers = Array . new ( 3 ) { Concurrent ::Event . new }
107
- barrier_queue = barriers . dup
108
- events = recording ( dir , :create ) { @notifier . stop }
103
+ recording ( dir , :create ) { @notifier . stop }
109
104
110
105
run_thread = Thread . new { @notifier . run }
106
+
111
107
dir . join ( "one.txt" ) . write ( "hello world" )
112
- run_thread . join
108
+ run_thread . join ( 1 ) or raise "timeout"
113
109
end
114
110
end
115
111
You can’t perform that action at this time.
0 commit comments