From beb1c085d582b4ac187309560eb871dda5bc3c28 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 13 Jul 2015 10:07:01 +0000 Subject: 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 --- test/test_timeout.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test_timeout.rb') 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 -- cgit v1.2.3