aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_timeout.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:07:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:07:01 +0000
commitbeb1c085d582b4ac187309560eb871dda5bc3c28 (patch)
tree70a84bbd1128ba33d3101bf9323a6977e6b2c754 /test/test_timeout.rb
parent42f1ff127249fe4d86c0f7b7ef2b920cbb71601b (diff)
downloadruby-beb1c085d582b4ac187309560eb871dda5bc3c28.tar.gz
use Timeout.timeout
* time: Object#timeout has been deprecated a long time ago, use Timeout.timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_timeout.rb')
-rw-r--r--test/test_timeout.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index fcaf7154d7..88a9b82099 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -6,7 +6,7 @@ class TestTimeout < Test::Unit::TestCase
def test_queue
q = Queue.new
assert_raise(Timeout::Error, "[ruby-dev:32935]") {
- timeout(0.01) { q.pop }
+ Timeout.timeout(0.01) { q.pop }
}
end
@@ -28,7 +28,7 @@ class TestTimeout < Test::Unit::TestCase
bug8730 = '[Bug #8730]'
e = nil
assert_raise_with_message(Timeout::Error, /execution expired/, bug8730) do
- timeout 0.01 do
+ Timeout.timeout 0.01 do
begin
sleep 3
rescue Exception => e
@@ -42,7 +42,7 @@ class TestTimeout < Test::Unit::TestCase
exc = Class.new(RuntimeError)
e = nil
assert_nothing_raised(exc) do
- timeout 0.01, exc do
+ Timeout.timeout 0.01, exc do
begin
sleep 3
rescue exc => e
@@ -58,10 +58,10 @@ class TestTimeout < Test::Unit::TestCase
def initialize(msg) super end
end
assert_nothing_raised(ArgumentError, bug9354) do
- assert_equal(:ok, timeout(100, err) {:ok})
+ assert_equal(:ok, Timeout.timeout(100, err) {:ok})
end
assert_raise_with_message(err, /execution expired/) do
- timeout 0.01, err do
+ Timeout.timeout 0.01, err do
sleep 3
end
end