Skip to content

Commit

Permalink
Expanded tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 19, 2024
1 parent 2a2b4ee commit 628f897
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions test/async/reactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,38 @@
end
end

it "reuses existing scheduler" do
# Assign the scheduler:
reactor = self.reactor

# Re-use the previous scheduler:
state = nil
Async do
state = :started
with 'Kernel.Async' do
it "reuses existing scheduler" do
# Assign the scheduler:
reactor = self.reactor

# Re-use the previous scheduler:
state = nil
Async do
state = :started
end

reactor.run

expect(state).to be == :started
end
end

with 'Kernel.Sync' do
it "reuses existing scheduler" do
# Assign the scheduler:
reactor = self.reactor

# Re-use the previous scheduler:
state = nil
Sync do |task|
state = :started
end

reactor.run

expect(state).to be == :started
end

reactor.run

expect(state).to be == :started
end
end

Expand Down

0 comments on commit 628f897

Please sign in to comment.