diff options
Diffstat (limited to 'spec/ruby/library/socket/option')
-rw-r--r-- | spec/ruby/library/socket/option/bool_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/socket/option/initialize_spec.rb | 12 | ||||
-rw-r--r-- | spec/ruby/library/socket/option/int_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/socket/option/linger_spec.rb | 8 | ||||
-rw-r--r-- | spec/ruby/library/socket/option/new_spec.rb | 6 |
5 files changed, 15 insertions, 15 deletions
diff --git a/spec/ruby/library/socket/option/bool_spec.rb b/spec/ruby/library/socket/option/bool_spec.rb index c4f8a277ba..144a78043d 100644 --- a/spec/ruby/library/socket/option/bool_spec.rb +++ b/spec/ruby/library/socket/option/bool_spec.rb @@ -21,7 +21,7 @@ describe "Socket::Option#bool" do platform_is_not :windows do it 'raises TypeError when called on a non boolean option' do opt = Socket::Option.linger(1, 4) - lambda { opt.bool }.should raise_error(TypeError) + -> { opt.bool }.should raise_error(TypeError) end end end diff --git a/spec/ruby/library/socket/option/initialize_spec.rb b/spec/ruby/library/socket/option/initialize_spec.rb index 0d4621b71e..8071ad7ef0 100644 --- a/spec/ruby/library/socket/option/initialize_spec.rb +++ b/spec/ruby/library/socket/option/initialize_spec.rb @@ -32,19 +32,19 @@ describe 'Socket::Option#initialize' do end it 'raises when using an invalid address family' do - lambda { + -> { Socket::Option.new(:INET2, :SOCKET, :KEEPALIVE, @bool) }.should raise_error(SocketError) end it 'raises when using an invalid level' do - lambda { + -> { Socket::Option.new(:INET, :CATS, :KEEPALIVE, @bool) }.should raise_error(SocketError) end it 'raises when using an invalid option name' do - lambda { + -> { Socket::Option.new(:INET, :SOCKET, :CATS, @bool) }.should raise_error(SocketError) end @@ -63,19 +63,19 @@ describe 'Socket::Option#initialize' do end it 'raises when using an invalid address family' do - lambda { + -> { Socket::Option.new('INET2', 'SOCKET', 'KEEPALIVE', @bool) }.should raise_error(SocketError) end it 'raises when using an invalid level' do - lambda { + -> { Socket::Option.new('INET', 'CATS', 'KEEPALIVE', @bool) }.should raise_error(SocketError) end it 'raises when using an invalid option name' do - lambda { + -> { Socket::Option.new('INET', 'SOCKET', 'CATS', @bool) }.should raise_error(SocketError) end diff --git a/spec/ruby/library/socket/option/int_spec.rb b/spec/ruby/library/socket/option/int_spec.rb index 5c67ec26d8..8c69ef6cbd 100644 --- a/spec/ruby/library/socket/option/int_spec.rb +++ b/spec/ruby/library/socket/option/int_spec.rb @@ -37,7 +37,7 @@ describe "Socket::Option#int" do platform_is_not :windows do it 'raises TypeError when called on a non integer option' do opt = Socket::Option.linger(1, 4) - lambda { opt.int }.should raise_error(TypeError) + -> { opt.int }.should raise_error(TypeError) end end end diff --git a/spec/ruby/library/socket/option/linger_spec.rb b/spec/ruby/library/socket/option/linger_spec.rb index 94467ebf71..ee987db85b 100644 --- a/spec/ruby/library/socket/option/linger_spec.rb +++ b/spec/ruby/library/socket/option/linger_spec.rb @@ -52,25 +52,25 @@ describe "Socket::Option#linger" do it "raises TypeError if not a SO_LINGER" do so = Socket::Option.int(:AF_UNSPEC, :SOL_SOCKET, :KEEPALIVE, 1) - lambda { so.linger }.should raise_error(TypeError) + -> { so.linger }.should raise_error(TypeError) end it 'raises TypeError when called on a non SOL_SOCKET/SO_LINGER option' do opt = Socket::Option.int(:INET, :IP, :TTL, 4) - lambda { opt.linger }.should raise_error(TypeError) + -> { opt.linger }.should raise_error(TypeError) end platform_is_not :windows do it "raises TypeError if option has not good size" do so = Socket::Option.int(:AF_UNSPEC, :SOL_SOCKET, :LINGER, 1) - lambda { so.linger }.should raise_error(TypeError) + -> { so.linger }.should raise_error(TypeError) end end it 'raises TypeError when called on a non linger option' do opt = Socket::Option.new(:INET, :SOCKET, :LINGER, '') - lambda { opt.linger }.should raise_error(TypeError) + -> { opt.linger }.should raise_error(TypeError) end end diff --git a/spec/ruby/library/socket/option/new_spec.rb b/spec/ruby/library/socket/option/new_spec.rb index f3b7b31c91..a9e6f09097 100644 --- a/spec/ruby/library/socket/option/new_spec.rb +++ b/spec/ruby/library/socket/option/new_spec.rb @@ -22,14 +22,14 @@ describe "Socket::Option.new" do end it "should raise error on unknown family" do - lambda { Socket::Option.new(:INET4, :SOCKET, :KEEPALIVE, [0].pack('i')) }.should raise_error(SocketError) + -> { Socket::Option.new(:INET4, :SOCKET, :KEEPALIVE, [0].pack('i')) }.should raise_error(SocketError) end it "should raise error on unknown level" do - lambda { Socket::Option.new(:INET, :ROCKET, :KEEPALIVE, [0].pack('i')) }.should raise_error(SocketError) + -> { Socket::Option.new(:INET, :ROCKET, :KEEPALIVE, [0].pack('i')) }.should raise_error(SocketError) end it "should raise error on unknown option name" do - lambda { Socket::Option.new(:INET, :SOCKET, :ALIVE, [0].pack('i')) }.should raise_error(SocketError) + -> { Socket::Option.new(:INET, :SOCKET, :ALIVE, [0].pack('i')) }.should raise_error(SocketError) end end |