diff options
author | Benoit Daloze <[email protected]> | 2024-11-06 21:57:34 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2024-11-06 21:58:28 +0100 |
commit | fdc82cca83bbbfe88f90d2888e139a6dde481101 (patch) | |
tree | 99165cce6af5eaca59316c06fed33f958c85e16a /spec/ruby/library/socket/basicsocket | |
parent | 9bc63e7ba066b31314bbd66def4932b398eaf4c9 (diff) |
Update to ruby/spec@54c391e
Diffstat (limited to 'spec/ruby/library/socket/basicsocket')
-rw-r--r-- | spec/ruby/library/socket/basicsocket/send_spec.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/spec/ruby/library/socket/basicsocket/send_spec.rb b/spec/ruby/library/socket/basicsocket/send_spec.rb index 86b5567026..1c028480e3 100644 --- a/spec/ruby/library/socket/basicsocket/send_spec.rb +++ b/spec/ruby/library/socket/basicsocket/send_spec.rb @@ -16,27 +16,27 @@ describe "BasicSocket#send" do @socket.close end - it "sends a message to another socket and returns the number of bytes sent" do - data = +"" - t = Thread.new do - client = @server.accept - loop do - got = client.recv(5) - break if got.nil? || got.empty? - data << got - end - client.close - end - Thread.pass while t.status and t.status != "sleep" - t.status.should_not be_nil + it "sends a message to another socket and returns the number of bytes sent" do + data = +"" + t = Thread.new do + client = @server.accept + loop do + got = client.recv(5) + break if got.nil? || got.empty? + data << got + end + client.close + end + Thread.pass while t.status and t.status != "sleep" + t.status.should_not be_nil - @socket.send('hello', 0).should == 5 - @socket.shutdown(1) # indicate, that we are done sending - @socket.recv(10) + @socket.send('hello', 0).should == 5 + @socket.shutdown(1) # indicate, that we are done sending + @socket.recv(10) - t.join - data.should == 'hello' - end + t.join + data.should == 'hello' + end platform_is_not :solaris, :windows do it "accepts flags to specify unusual sending behaviour" do |