summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2026-01-28 22:30:21 +0100
committerBenoit Daloze <eregontp@gmail.com>2026-01-28 23:01:22 +0100
commitdbd2ff7adca9b49e4bfa7bc3ec8b83bd437f8cb7 (patch)
tree5f4f1609d2015fde92c25b175b84078dfcf1c92f /spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb
parenta8b877a843643fbdccd1a42efaf94ad27705dd55 (diff)
Update to ruby/spec@83e26c9
Diffstat (limited to 'spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb')
-rw-r--r--spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb69
1 files changed, 18 insertions, 51 deletions
diff --git a/spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb b/spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb
index b5fdd7c93b..d1cde4411b 100644
--- a/spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb
+++ b/spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb
@@ -235,64 +235,31 @@ describe 'BasicSocket#recvmsg_nonblock' do
@server.close unless @server.closed?
end
- ruby_version_is ""..."3.3" do
- platform_is_not :windows do # #recvmsg_nonblock() raises 'Errno::EINVAL: Invalid argument - recvmsg(2)'
- it "returns an empty String as received data on a closed stream socket" do
- ready = false
+ platform_is_not :windows do
+ it "returns nil on a closed stream socket" do
+ ready = false
- t = Thread.new do
- client = @server.accept
+ t = Thread.new do
+ client = @server.accept
- Thread.pass while !ready
- begin
- client.recvmsg_nonblock(10)
- rescue IO::EAGAINWaitReadable
- retry
- end
- ensure
- client.close if client
+ Thread.pass while !ready
+ begin
+ client.recvmsg_nonblock(10)
+ rescue IO::EAGAINWaitReadable
+ retry
end
-
- Thread.pass while t.status and t.status != "sleep"
- t.status.should_not be_nil
-
- socket = TCPSocket.new('127.0.0.1', @port)
- socket.close
- ready = true
-
- t.value.should.is_a? Array
- t.value[0].should == ""
+ ensure
+ client.close if client
end
- end
- end
- ruby_version_is "3.3" do
- platform_is_not :windows do
- it "returns nil on a closed stream socket" do
- ready = false
+ Thread.pass while t.status and t.status != "sleep"
+ t.status.should_not be_nil
- t = Thread.new do
- client = @server.accept
+ socket = TCPSocket.new('127.0.0.1', @port)
+ socket.close
+ ready = true
- Thread.pass while !ready
- begin
- client.recvmsg_nonblock(10)
- rescue IO::EAGAINWaitReadable
- retry
- end
- ensure
- client.close if client
- end
-
- Thread.pass while t.status and t.status != "sleep"
- t.status.should_not be_nil
-
- socket = TCPSocket.new('127.0.0.1', @port)
- socket.close
- ready = true
-
- t.value.should be_nil
- end
+ t.value.should be_nil
end
end
end