summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-12-06 15:56:14 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-12-06 16:03:16 +0900
commit2f6a8baac6a84935cef1f10adbba2f47df4a2346 (patch)
treef251d2abf4970c95e418558fca018a7b41cb80f2
parent2c8d186c6e4fd03ea57466fa6dce6bad40d09401 (diff)
Test interfaces include localhost
When interfaces do not include localhost, some other tests may fail.
-rw-r--r--test/socket/test_socket.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 3b2ea51b94..f1ec927c4c 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -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