Relax test conditions to velify Socket::ResolutionError#error_code

The test for Socket::ResolutionError#error_code fails in the FreeBSD environment with this test condition. Because Socket::ResolutionError#error_code returns Socket::EAI_FAIL instead of Socket::EAI_FAMILY.

https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz

This PR avoids the test failure by relaxing the condition.

Also changed the domain for testing to `example.com`.
This commit is contained in:
Misaki Shioi 2023-12-01 09:31:33 +09:00 коммит произвёл Hiroshi SHIBATA
Родитель e2bbbacc23
Коммит 1bfd30a1e3
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -771,13 +771,10 @@ class TestSocket < Test::Unit::TestCase
end
def test_resolurion_error_error_code
# https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz
omit if /freebsd/ =~ RUBY_PLATFORM
begin
Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX")
Socket.getaddrinfo("example.com", 80, "AF_UNIX")
rescue => e
assert_equal(Socket::EAI_FAMILY, e.error_code)
assert_equal([Socket::EAI_FAMILY, Socket::EAI_FAIL].include?(e.error_code), true)
end
end