diff options
author | Kazuhiro NISHIYAMA <[email protected]> | 2024-12-03 13:25:20 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <[email protected]> | 2024-12-03 13:56:26 +0900 |
commit | bbcb094e2d1501079eeec2104800cc0df9cc540f (patch) | |
tree | 4732d6ad88ef7d57c8771fbf32e9bca297171b41 | |
parent | 9297a4cbc7f684db630e3e3687c5d6b9efc11efe (diff) |
Socket#connect may be raise ECONNREFUSED
On my environment with `sudo ufw default reject outgoing`,
outgoing packets are filtered without allow rules.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12238
-rw-r--r-- | spec/ruby/library/socket/socket/connect_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/ruby/library/socket/socket/connect_spec.rb b/spec/ruby/library/socket/socket/connect_spec.rb index 175c9942bc..7fceb47b00 100644 --- a/spec/ruby/library/socket/socket/connect_spec.rb +++ b/spec/ruby/library/socket/socket/connect_spec.rb @@ -63,7 +63,11 @@ describe 'Socket#connect' do client.timeout = 0 -> { - client.connect(address) + begin + client.connect(address) + rescue Errno::ECONNREFUSED + skip "Outgoing packets may be filtered" + end }.should raise_error(IO::TimeoutError) end end |