Skip to content

Commit

Permalink
Failing test for issue 185
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Sep 29, 2011
1 parent 427a76d commit 50502e6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,26 @@ def test_fork_safe
read.close rescue nil
write.close rescue nil
end

def test_error_handler_idempotent # issue 185
errors = []
ticks = []
EM.error_handler do |e|
errors << e
end

EM.run do
EM.next_tick do
ticks << :first
raise
end
EM.next_tick do
ticks << :second
end
EM.add_timer(0.001) { EM.stop }
end

assert_equal 1, errors.size
assert_equal [:first, :second], ticks
end
end

0 comments on commit 50502e6

Please sign in to comment.