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
This commit is contained in:
nobu 2015-07-13 10:07:01 +00:00
parent 42f1ff1272
commit beb1c085d5
16 changed files with 43 additions and 43 deletions

View file

@ -355,7 +355,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
req = Net::HTTP::Get.new("/")
req['Connection'] = 'Keep-Alive'
begin
timeout(2) do
Timeout.timeout(2) do
http.request(req){|res| assert_equal("foo", res.body) }
end
rescue Timeout::Error