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

Some environments do not have IPv6 address of localhost in /etc/hosts

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-08-08 08:00:45 +00:00
parent 953b7a2056
commit 60012d130c

View file

@ -37,13 +37,13 @@ describe 'Addrinfo.getaddrinfo' do
guard -> { SocketSpecs.ipv6_available? } do guard -> { SocketSpecs.ipv6_available? } do
it 'sets a custom protocol family of the Addrinfo instances' do it 'sets a custom protocol family of the Addrinfo instances' do
array = Addrinfo.getaddrinfo('localhost', 80, Socket::PF_INET6) array = Addrinfo.getaddrinfo('::1', 80, Socket::PF_INET6)
array[0].pfamily.should == Socket::PF_INET6 array[0].pfamily.should == Socket::PF_INET6
end end
it 'sets a corresponding address family based on a custom protocol family' do it 'sets a corresponding address family based on a custom protocol family' do
array = Addrinfo.getaddrinfo('localhost', 80, Socket::PF_INET6) array = Addrinfo.getaddrinfo('::1', 80, Socket::PF_INET6)
array[0].afamily.should == Socket::AF_INET6 array[0].afamily.should == Socket::AF_INET6
end end