diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-14 06:55:00 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-14 06:55:00 +0000 |
commit | e6a5f817d613dbd40cf2d19cd0705a1b4c377538 (patch) | |
tree | 0e38c2d393104777c836c80036c0e9945098fb09 /test | |
parent | dd7f1cdfbd8215ee46c11175bfd2f4fd3569f34a (diff) |
merge revision(s) 48534: [Backport #10412]
* 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/branches/ruby_2_0_0@49245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/resolv/test_dns.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb index 07396fb177..4d83d88a17 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 |