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.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index dfa863b373..9ec9c02a93 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -9,5 +9,18 @@ class TestTimeout < Test::Unit::TestCase
timeout(0.1) { q.pop }
}
end
-end
+ def test_timeout
+ @flag = true
+ Thread.start {
+ sleep 0.1
+ @flag = false
+ }
+ assert_nothing_raised("[ruby-dev:38319]") do
+ Timeout.timeout(1) {
+ nil while @flag
+ }
+ end
+ assert !@flag, "[ruby-dev:38319]"
+ end
+end