summaryrefslogtreecommitdiff
path: root/test/resolv/test_dns.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-24 18:59:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-24 18:59:45 +0000
commit32f124e68a8743ff0b2182802dd3c09c14aa945c (patch)
tree67c22b55072b15264db058a4f8afc80bb54d0578 /test/resolv/test_dns.rb
parentfbbf715d275ea646d8ce46710895b094dd5f6a77 (diff)
use timeout lib
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/resolv/test_dns.rb')
-rw-r--r--test/resolv/test_dns.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb
index 687ffef..f3f6ec2 100644
--- a/test/resolv/test_dns.rb
+++ b/test/resolv/test_dns.rb
@@ -160,10 +160,11 @@ class TestResolvDNS < Test::Unit::TestCase
# A rase condition here.
# Another program may use the port.
# But no way to prevent it.
- Resolv::DNS.open(:nameserver_port => [[host, port]]) {|dns|
- dns.timeouts = 0.1
- assert_equal([], dns.getresources("test-no-server.example.org", Resolv::DNS::Resource::IN::A))
- }
+ 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))
+ }
+ end
end
def test_invalid_byte_comment