summaryrefslogtreecommitdiff
path: root/test/thread/test_thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/thread/test_thread.rb')
-rw-r--r--test/thread/test_thread.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/thread/test_thread.rb b/test/thread/test_thread.rb
index fe5fdeffda..7a4d110fea 100644
--- a/test/thread/test_thread.rb
+++ b/test/thread/test_thread.rb
@@ -115,5 +115,14 @@ class TC_Thread < Test::Unit::TestCase
# Now unlock. The mutex should be free, so Mutex#unlock should return nil
assert(! m.unlock)
end
+
+ def test_queue_rescue
+ require "timeout"
+ queue = Queue.new
+ assert_raises(Timeout::Error) {Timeout.timeout(0.001) {queue.pop}}
+ queue.push(1)
+ assert_nothing_raised("[ruby-dev:37545]") {assert_equal(1, queue.pop)}
+ assert(queue.empty?)
+ end
end