1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix Resolv specs to not depend on a system /etc/hosts file

* 20190609T153804Z.fail.html.gz
* Thanks @naruse for the tip.
This commit is contained in:
Benoit Daloze 2019-06-10 12:45:00 +02:00
parent 614154bbb6
commit 60af6fef3c
5 changed files with 16 additions and 15 deletions

View file

@ -4,9 +4,10 @@ require 'resolv'
describe "Resolv#getname" do
platform_is_not :windows do
it "resolves 127.0.0.1" do
lambda {
Resolv.getname("127.0.0.1")
}.should_not raise_error(Resolv::ResolvError)
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
res = Resolv.new([hosts])
res.getname("127.0.0.1").should == "localhost"
end
end