1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-07-29 22:11:21 +02:00
parent 15d05f8120
commit 6998d75824
186 changed files with 3956 additions and 3339 deletions

View file

@ -67,4 +67,25 @@ describe "Socket::BasicSocket#recv_nonblock" do
}.should raise_error(IO::WaitReadable)
end
end
SocketSpecs.each_ip_protocol do |family, ip_address|
describe 'using a connected but not bound socket' do
before do
@server = Socket.new(family, :STREAM)
end
after do
@server.close
end
it "raises Errno::ENOTCONN" do
-> { @server.recv_nonblock(1) }.should raise_error { |e|
[Errno::ENOTCONN, Errno::EINVAL].should.include?(e.class)
}
-> { @server.recv_nonblock(1, exception: false) }.should raise_error { |e|
[Errno::ENOTCONN, Errno::EINVAL].should.include?(e.class)
}
end
end
end
end