mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@d6921ef
This commit is contained in:
parent
207a5a5bc1
commit
a6c6eef04a
44 changed files with 1141 additions and 250 deletions
|
@ -14,6 +14,14 @@ describe :tcpsocket_new, shared: true do
|
|||
}
|
||||
end
|
||||
|
||||
ruby_version_is "3.0" do
|
||||
it 'raises Errno::ETIMEDOUT with :connect_timeout when no server is listening on the given address' do
|
||||
-> {
|
||||
TCPSocket.send(@method, "192.0.2.1", 80, connect_timeout: 0)
|
||||
}.should raise_error(Errno::ETIMEDOUT)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with a running server" do
|
||||
before :each do
|
||||
@server = SocketSpecs::SpecTCPServer.new
|
||||
|
@ -75,5 +83,12 @@ describe :tcpsocket_new, shared: true do
|
|||
@socket.addr[1].should be_kind_of(Integer)
|
||||
@socket.addr[2].should =~ /^#{@hostname}/
|
||||
end
|
||||
|
||||
ruby_version_is "3.0" do
|
||||
it "connects to a server when passed connect_timeout argument" do
|
||||
@socket = TCPSocket.send(@method, @hostname, @server.port, connect_timeout: 1)
|
||||
@socket.should be_an_instance_of(TCPSocket)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue