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

Specify the socktype explicitly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2016-12-04 05:05:54 +00:00
parent 94e8036b85
commit 7a5ad716d0

View file

@ -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__)