Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 28, 2023
1 parent 5cb8598 commit 7d52449
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/async/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,21 @@

expect(task).to be(:running?)
expect(duration).to be <= 0.1
ensure
Fiber.set_scheduler(nil)
end
end

with '#interrupt' do
it "can interrupt a scheduler while it's not running" do
scheduler = Async::Scheduler.new
scheduler.run do
# Essentially sleep forever:
scheduler.transfer
end
scheduler.interrupt
end

it "can interrupt a closed scheduler" do
scheduler = Async::Scheduler.new
scheduler.close
Expand Down

0 comments on commit 7d52449

Please sign in to comment.