From 08f14b8d4cf2058e8f23f3c6dab37c82c5e73d70 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 3 Sep 2024 18:21:01 -0700 Subject: [PATCH] Allow Errno::EACCES when testing connection timeout Some packaging systems that include support for running tests, such as OpenBSD's, do not allow outbound network connections during testing for security reasons. EACCES is the error raised by OpenBSD in this case. --- test/socket/test_tcp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb index 7f9dc53cae..6a016da71d 100644 --- a/test/socket/test_tcp.rb +++ b/test/socket/test_tcp.rb @@ -70,7 +70,7 @@ class TestSocket_TCPSocket < Test::Unit::TestCase end def test_initialize_connect_timeout - assert_raise(IO::TimeoutError, Errno::ENETUNREACH) do + assert_raise(IO::TimeoutError, Errno::ENETUNREACH, Errno::EACCES) do TCPSocket.new("192.0.2.1", 80, connect_timeout: 0) end end