[前][次][番号順一覧][スレッド一覧]

ruby-changes:59099

From: Kazuhiro <ko1@a...>
Date: Fri, 6 Dec 2019 16:03:59 +0900 (JST)
Subject: [ruby-changes:59099] 2f6a8baac6 (master): Test interfaces include localhost

https://git.ruby-lang.org/ruby.git/commit/?id=2f6a8baac6

From 2f6a8baac6a84935cef1f10adbba2f47df4a2346 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Fri, 6 Dec 2019 15:56:14 +0900
Subject: Test interfaces include localhost

When interfaces do not include localhost,
some other tests may fail.

diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 3b2ea51..f1ec927 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -121,6 +121,15 @@ class TestSocket < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_socket.rb#L121
     }
   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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]