summaryrefslogtreecommitdiff
path: root/test/test_timeout.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_timeout.rb')
-rw-r--r--test/test_timeout.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index c0d6e1bf65..117c1402fa 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -75,4 +75,15 @@ class TestTimeout < Test::Unit::TestCase
end
end
end
+
+ def test_enumerator_next
+ bug9380 = '[ruby-dev:47872] [Bug #9380]: timeout in Enumerator#next'
+ e = (o=Object.new).to_enum
+ def o.each
+ sleep
+ end
+ assert_raise_with_message(Timeout::Error, 'execution expired', bug9380) do
+ Timeout.timeout(0.01) {e.next}
+ end
+ end
end