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

ruby-changes:44904

From: shugo <ko1@a...>
Date: Sun, 4 Dec 2016 13:53:37 +0900 (JST)
Subject: [ruby-changes:44904] shugo:r56977 (trunk): Use 127.0.0.1 if getaddrinfo fails.

shugo	2016-12-04 13:53:33 +0900 (Sun, 04 Dec 2016)

  New Revision: 56977

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56977

  Log:
    Use 127.0.0.1 if getaddrinfo fails.

  Modified files:
    trunk/test/net/ftp/test_ftp.rb
Index: test/net/ftp/test_ftp.rb
===================================================================
--- test/net/ftp/test_ftp.rb	(revision 56976)
+++ test/net/ftp/test_ftp.rb	(revision 56977)
@@ -8,7 +8,8 @@ require "tempfile" https://github.com/ruby/ruby/blob/trunk/test/net/ftp/test_ftp.rb#L8
 
 class FTPTest < Test::Unit::TestCase
   SERVER_NAME = "localhost"
-  SERVER_ADDR = Addrinfo.getaddrinfo(SERVER_NAME, 0)[0].ip_address
+  SERVER_ADDR =
+    Addrinfo.getaddrinfo(SERVER_NAME, 0)[0].ip_address rescue "127.0.0.1"
   CA_FILE = File.expand_path("../fixtures/cacert.pem", __dir__)
   SERVER_KEY = File.expand_path("../fixtures/server.key", __dir__)
   SERVER_CERT = File.expand_path("../fixtures/server.crt", __dir__)

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

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