Skip to content

Commit bbcb094

Browse files
committed
Socket#connect may be raise ECONNREFUSED
On my environment with `sudo ufw default reject outgoing`, outgoing packets are filtered without allow rules.
1 parent 9297a4c commit bbcb094

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/ruby/library/socket/socket/connect_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@
6363
client.timeout = 0
6464

6565
-> {
66-
client.connect(address)
66+
begin
67+
client.connect(address)
68+
rescue Errno::ECONNREFUSED
69+
skip "Outgoing packets may be filtered"
70+
end
6771
}.should raise_error(IO::TimeoutError)
6872
end
6973
end

0 commit comments

Comments
 (0)