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

Test interfaces include localhost

When interfaces do not include localhost,
some other tests may fail.
This commit is contained in:
Kazuhiro NISHIYAMA 2019-12-06 15:56:14 +09:00
parent 2c8d186c6e
commit 2f6a8baac6
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -121,6 +121,15 @@ class TestSocket < Test::Unit::TestCase
}
end
def test_ip_address_list_include_localhost
begin
list = Socket.ip_address_list
rescue NotImplementedError
return
end
assert_includes list.map(&:ip_address), Addrinfo.tcp("localhost", 0).ip_address
end
def test_tcp
TCPServer.open(0) {|serv|
addr = serv.connect_address