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/resolv/test_dns.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/resolv/test_dns.rb') diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb index d7e5c3683a..e7857248ce 100644 --- a/test/resolv/test_dns.rb +++ b/test/resolv/test_dns.rb @@ -53,7 +53,7 @@ class TestResolvDNS < Test::Unit::TestCase } } server_thread = Thread.new { - msg, (_, client_port, _, client_address) = timeout(5) {u.recvfrom(4096)} + msg, (_, client_port, _, client_address) = Timeout.timeout(5) {u.recvfrom(4096)} id, word2, qdcount, ancount, nscount, arcount = msg.unpack("nnnnnn") qr = (word2 & 0x8000) >> 15 opcode = (word2 & 0x7800) >> 11 @@ -160,7 +160,7 @@ class TestResolvDNS < Test::Unit::TestCase # A rase condition here. # Another program may use the port. # But no way to prevent it. - timeout(5) do + Timeout.timeout(5) do Resolv::DNS.open(:nameserver_port => [[host, port]]) {|dns| assert_equal([], dns.getresources("test-no-server.example.org", Resolv::DNS::Resource::IN::A)) } -- cgit v1.2.3