Skip to content

Commit ba7738a

Browse files
Fix test.
1 parent e5af586 commit ba7738a

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/async/task.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -298,19 +298,21 @@
298298
end
299299

300300
it "reports failed status for failed tasks" do
301-
task = reactor.async do
302-
raise "Test failure"
303-
end
304-
305-
# Wait for the task to fail
306-
begin
307-
task.wait
308-
rescue
309-
# Expected
301+
reactor.run do
302+
task = reactor.async do
303+
raise "Test failure"
304+
end
305+
306+
# Wait for the task to fail
307+
begin
308+
task.wait
309+
rescue
310+
# Expected
311+
end
312+
313+
expect(task.status).to be == :failed
314+
expect(task.failed?).to be == true
310315
end
311-
312-
expect(task.status).to be == :failed
313-
expect(task.failed?).to be == true
314316
end
315317

316318
it "status changes reflect task lifecycle" do

0 commit comments

Comments
 (0)