Skip to content
Browse files

Failing test for issue 185

  • Loading branch information...
1 parent 427a76d commit 50502e6ae8402b5fc76c6946139a5abe481dfd54 @raggi raggi committed
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/test_basic.rb
View
22 tests/test_basic.rb
@@ -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.
Something went wrong with that request. Please try again.