summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/shared/socketpair.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/shared/socketpair.rb')
-rw-r--r--spec/ruby/library/socket/shared/socketpair.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/spec/ruby/library/socket/shared/socketpair.rb b/spec/ruby/library/socket/shared/socketpair.rb
index 08db2e59b8..7fcd4d6b46 100644
--- a/spec/ruby/library/socket/shared/socketpair.rb
+++ b/spec/ruby/library/socket/shared/socketpair.rb
@@ -12,8 +12,8 @@ describe :socket_socketpair, shared: true do
begin
s1, s2 = Socket.public_send(@method, :UNIX, :STREAM)
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
ensure
s1.close
s2.close
@@ -24,8 +24,8 @@ describe :socket_socketpair, shared: true do
it 'returns two Socket objects' do
s1, s2 = Socket.public_send(@method, Socket::AF_UNIX, Socket::SOCK_STREAM)
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
s1.close
s2.close
end
@@ -35,18 +35,18 @@ describe :socket_socketpair, shared: true do
it 'returns two Socket objects' do
s1, s2 = Socket.public_send(@method, :UNIX, :STREAM)
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
s1.close
s2.close
end
it 'raises SocketError for an unknown address family' do
- lambda { Socket.public_send(@method, :CATS, :STREAM) }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, :CATS, :STREAM) }.should.raise(SocketError)
end
it 'raises SocketError for an unknown socket type' do
- lambda { Socket.public_send(@method, :UNIX, :CATS) }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, :UNIX, :CATS) }.should.raise(SocketError)
end
end
@@ -54,18 +54,18 @@ describe :socket_socketpair, shared: true do
it 'returns two Socket objects' do
s1, s2 = Socket.public_send(@method, 'UNIX', 'STREAM')
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
s1.close
s2.close
end
it 'raises SocketError for an unknown address family' do
- lambda { Socket.public_send(@method, 'CATS', 'STREAM') }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, 'CATS', 'STREAM') }.should.raise(SocketError)
end
it 'raises SocketError for an unknown socket type' do
- lambda { Socket.public_send(@method, 'UNIX', 'CATS') }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, 'UNIX', 'CATS') }.should.raise(SocketError)
end
end
@@ -79,8 +79,8 @@ describe :socket_socketpair, shared: true do
s1, s2 = Socket.public_send(@method, family, type)
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
s1.close
s2.close
end
@@ -92,7 +92,7 @@ describe :socket_socketpair, shared: true do
family.stub!(:to_str).and_return(Socket::AF_UNIX)
type.stub!(:to_str).and_return(Socket::SOCK_STREAM)
- lambda { Socket.public_send(@method, family, type) }.should raise_error(TypeError)
+ -> { Socket.public_send(@method, family, type) }.should.raise(TypeError)
end
it 'raises SocketError for an unknown address family' do
@@ -102,7 +102,7 @@ describe :socket_socketpair, shared: true do
family.stub!(:to_str).and_return('CATS')
type.stub!(:to_str).and_return('STREAM')
- lambda { Socket.public_send(@method, family, type) }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, family, type) }.should.raise(SocketError)
end
it 'raises SocketError for an unknown socket type' do
@@ -112,14 +112,14 @@ describe :socket_socketpair, shared: true do
family.stub!(:to_str).and_return('UNIX')
type.stub!(:to_str).and_return('CATS')
- lambda { Socket.public_send(@method, family, type) }.should raise_error(SocketError)
+ -> { Socket.public_send(@method, family, type) }.should.raise(SocketError)
end
end
it 'accepts a custom protocol as an Integer as the 3rd argument' do
s1, s2 = Socket.public_send(@method, :UNIX, :STREAM, Socket::IPPROTO_IP)
- s1.should be_an_instance_of(Socket)
- s2.should be_an_instance_of(Socket)
+ s1.should.instance_of?(Socket)
+ s2.should.instance_of?(Socket)
s1.close
s2.close
end