diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-04 05:05:54 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-04 05:05:54 +0000 |
commit | 4db94d8b22ad93505ee9e7bb6e3304c03e4e9d9c (patch) | |
tree | b467c7f63097e289bca02b51326ae148d3029b83 /test/net | |
parent | a5b1a0376f5a3cd6b3a7643da53f9995f0c86346 (diff) | |
download | ruby-4db94d8b22ad93505ee9e7bb6e3304c03e4e9d9c.tar.gz |
Specify the socktype explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/ftp/test_ftp.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 64592765e8..6976f11b8f 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -9,7 +9,11 @@ require "tempfile" class FTPTest < Test::Unit::TestCase SERVER_NAME = "localhost" SERVER_ADDR = - Addrinfo.getaddrinfo(SERVER_NAME, 0)[0].ip_address rescue "127.0.0.1" + begin + Addrinfo.getaddrinfo(SERVER_NAME, 0, nil, :STREAM)[0].ip_address + rescue SocketError + "127.0.0.1" + end 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__) |