summaryrefslogtreecommitdiff
path: root/spec/ruby/library
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-08 13:50:25 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-08 13:50:25 +0000
commit4b13656e39fa5da58af9df534570965d5692e9c3 (patch)
treec56b941968e6c16558d42910c2b93b593fdfad37 /spec/ruby/library
parente0cece9d4d0b58dda98bf64a5a83e78797f8d70d (diff)
fix MSG_OOB spec
* OOBINLINE should be set for accepted socket * When OOBINLINE is set, MSG_OOB shouldn't be passed to recv Merge spec/ruby's commit 5b418374f8006318434ee9a2366382d004f585df git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library')
-rw-r--r--spec/ruby/library/socket/basicsocket/send_spec.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/spec/ruby/library/socket/basicsocket/send_spec.rb b/spec/ruby/library/socket/basicsocket/send_spec.rb
index a405916bfc..c4845fc09e 100644
--- a/spec/ruby/library/socket/basicsocket/send_spec.rb
+++ b/spec/ruby/library/socket/basicsocket/send_spec.rb
@@ -196,17 +196,11 @@ describe 'BasicSocket#send' do
describe 'using the MSG_OOB flag' do
it 'sends an out-of-band message' do
- @server.setsockopt(:SOCKET, :OOBINLINE, true)
-
- @client.send('a', Socket::MSG_OOB).should == 1
-
- platform_is :freebsd do # recv hangs otherwise
- @client.close
- end
-
socket, _ = @server.accept
+ socket.setsockopt(:SOCKET, :OOBINLINE, true)
+ @client.send('a', Socket::MSG_OOB).should == 1
begin
- socket.recv(1, Socket::MSG_OOB).should == 'a'
+ socket.recv(10).should == 'a'
ensure
socket.close
end