summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket')
-rw-r--r--spec/ruby/library/socket/addrinfo/initialize_spec.rb2
-rw-r--r--spec/ruby/library/socket/basicsocket/send_spec.rb38
2 files changed, 20 insertions, 20 deletions
diff --git a/spec/ruby/library/socket/addrinfo/initialize_spec.rb b/spec/ruby/library/socket/addrinfo/initialize_spec.rb
index 83b204b575..d8885c5d62 100644
--- a/spec/ruby/library/socket/addrinfo/initialize_spec.rb
+++ b/spec/ruby/library/socket/addrinfo/initialize_spec.rb
@@ -335,7 +335,7 @@ describe "Addrinfo#initialize" do
@sockaddr = ['AF_INET6', 80, 'hostname', '127.0.0.1']
end
- it "raises SocketError when using any Socket constant except except AF_INET(6)/PF_INET(6)" do
+ it "raises SocketError when using any Socket constant except AF_INET(6)/PF_INET(6)" do
Socket.constants.grep(/(^AF_|^PF_)(?!INET)/).each do |constant|
value = Socket.const_get(constant)
-> {
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