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
* 20190609
T153804Z.fail.html.gz
* Thanks @naruse for the tip.
This commit is contained in:
parent
614154bbb6
commit
60af6fef3c
5 changed files with 16 additions and 15 deletions
|
@ -4,11 +4,11 @@ require 'resolv'
|
|||
describe "Resolv#getaddress" do
|
||||
platform_is_not :windows do
|
||||
it "resolves localhost" do
|
||||
res = Resolv.new([Resolv::Hosts.new])
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
|
||||
lambda {
|
||||
res.getaddress("localhost")
|
||||
}.should_not raise_error(Resolv::ResolvError)
|
||||
res.getaddress("localhost").should == "127.0.0.1"
|
||||
res.getaddress("localhost4").should == "127.0.0.1"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue