mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Resolv specs should pass on Windows now
This commit is contained in:
parent
60af6fef3c
commit
626ae5a9b6
4 changed files with 18 additions and 26 deletions
|
@ -2,14 +2,12 @@ require_relative '../../spec_helper'
|
|||
require 'resolv'
|
||||
|
||||
describe "Resolv#getaddress" do
|
||||
platform_is_not :windows do
|
||||
it "resolves localhost" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
it "resolves localhost" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
|
||||
res.getaddress("localhost").should == "127.0.0.1"
|
||||
res.getaddress("localhost4").should == "127.0.0.1"
|
||||
end
|
||||
res.getaddress("localhost").should == "127.0.0.1"
|
||||
res.getaddress("localhost4").should == "127.0.0.1"
|
||||
end
|
||||
|
||||
it "raises ResolvError if the name can not be looked up" do
|
||||
|
|
|
@ -2,13 +2,11 @@ require_relative '../../spec_helper'
|
|||
require 'resolv'
|
||||
|
||||
describe "Resolv#getaddresses" do
|
||||
platform_is_not :windows do
|
||||
it "resolves localhost" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
it "resolves localhost" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
|
||||
res.getaddresses("localhost").should == ["127.0.0.1"]
|
||||
res.getaddresses("localhost4").should == ["127.0.0.1"]
|
||||
end
|
||||
res.getaddresses("localhost").should == ["127.0.0.1"]
|
||||
res.getaddresses("localhost4").should == ["127.0.0.1"]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,13 +2,11 @@ require_relative '../../spec_helper'
|
|||
require 'resolv'
|
||||
|
||||
describe "Resolv#getname" do
|
||||
platform_is_not :windows do
|
||||
it "resolves 127.0.0.1" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
it "resolves 127.0.0.1" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
|
||||
res.getname("127.0.0.1").should == "localhost"
|
||||
end
|
||||
res.getname("127.0.0.1").should == "localhost"
|
||||
end
|
||||
|
||||
it "raises ResolvError when there is no result" do
|
||||
|
|
|
@ -2,12 +2,10 @@ require_relative '../../spec_helper'
|
|||
require 'resolv'
|
||||
|
||||
describe "Resolv#getnames" do
|
||||
platform_is_not :windows do
|
||||
it "resolves 127.0.0.1" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
it "resolves 127.0.0.1" do
|
||||
hosts = Resolv::Hosts.new(fixture(__FILE__ , "hosts"))
|
||||
res = Resolv.new([hosts])
|
||||
|
||||
names = res.getnames("127.0.0.1").should == ["localhost", "localhost4"]
|
||||
end
|
||||
names = res.getnames("127.0.0.1").should == ["localhost", "localhost4"]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue