Skip to content

Commit

Permalink
Prefer to use reactor.run for test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Nov 6, 2024
1 parent 27cab00 commit fd136d6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/async/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,14 @@ def sleep_forever
with "#result" do
it "does not raise exception" do
task = reactor.async do
# Prevent `io_write` hook being invoked.
expect(Console).to receive(:warn).and_return(nil)

raise "The space time converter has failed."
end

expect do
task.wait
end.to raise_exception(RuntimeError, message: be =~ /space time converter/)
reactor.run do
expect do
task.wait
end.to raise_exception(RuntimeError, message: be =~ /space time converter/)
end

expect(task.result).to be_a(RuntimeError)
end
Expand Down

0 comments on commit fd136d6

Please sign in to comment.