Skip to content

Commit

Permalink
Add connect_timeout expect
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanCrg90 committed Oct 14, 2021
1 parent 9597d4b commit 64b787e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/socket/tcpsocket/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
@client.local_address.ip_port.should_not == @port
end
end

describe 'when server connection is timeout' do
ruby_version_is "3.0" do
it 'raises Errno::ETIMEDOUT' do
-> { TCPSocket.new(ip_address, @port, connect_timeout: 0) }.should raise_error(Errno::ETIMEDOUT)
end
end
end
end
end
end

0 comments on commit 64b787e

Please sign in to comment.