summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <[email protected]>2024-12-03 13:25:20 +0900
committerKazuhiro NISHIYAMA <[email protected]>2024-12-03 13:56:26 +0900
commitbbcb094e2d1501079eeec2104800cc0df9cc540f (patch)
tree4732d6ad88ef7d57c8771fbf32e9bca297171b41 /spec/ruby/library/socket
parent9297a4cbc7f684db630e3e3687c5d6b9efc11efe (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
Diffstat (limited to 'spec/ruby/library/socket')
-rw-r--r--spec/ruby/library/socket/socket/connect_spec.rb6
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