summaryrefslogtreecommitdiff
path: root/test/resolv/test_dns.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 20:04:27 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-21 20:04:27 +0000
commit570c028c7ebb18c6d276e5fac3a1b20f76f28db7 (patch)
tree632b274229b0854d82e1b655fe34cd5cff26f53d /test/resolv/test_dns.rb
parent8eb0c810b228df1f8352c005a7ae882ad4179b4b (diff)
* lib/resolv.rb: fall back if canonicalization fails.
Thanks Vit Ondruch for the patch! [ruby-core:65836] * test/resolv/test_dns.rb: test for patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/resolv/test_dns.rb')
-rw-r--r--test/resolv/test_dns.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb
index bd5d2e1..4ace87c 100644
--- a/test/resolv/test_dns.rb
+++ b/test/resolv/test_dns.rb
@@ -23,6 +23,20 @@ class TestResolvDNS < Test::Unit::TestCase
end
end
+ # [ruby-core:65836]
+ def test_resolve_with_2_ndots
+ conf = Resolv::DNS::Config.new :nameserver => ['127.0.0.1'], :ndots => 2
+ assert conf.single?
+
+ candidates = []
+ conf.resolv('example.com') { |candidate, *args|
+ candidates << candidate
+ raise Resolv::DNS::Config::NXDomain
+ }
+ n = Resolv::DNS::Name.create 'example.com.'
+ assert_equal n, candidates.last
+ end
+
def test_query_ipv4_address
begin
OpenSSL