diff options
Diffstat (limited to 'spec/ruby/library/socket/ancillarydata')
7 files changed, 54 insertions, 54 deletions
diff --git a/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb b/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb index 50763e28b1..c77f3bdbae 100644 --- a/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb @@ -26,7 +26,7 @@ with_feature :ancillary_data do end it 'raises SocketError when comparing with :IPV6 and :RIGHTS' do - lambda { @data.cmsg_is?(:IPV6, :RIGHTS) }.should raise_error(SocketError) + -> { @data.cmsg_is?(:IPV6, :RIGHTS) }.should.raise(SocketError) end end end diff --git a/spec/ruby/library/socket/ancillarydata/initialize_spec.rb b/spec/ruby/library/socket/ancillarydata/initialize_spec.rb index d4788d0f68..60f5ac7a90 100644 --- a/spec/ruby/library/socket/ancillarydata/initialize_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/initialize_spec.rb @@ -106,34 +106,34 @@ with_feature :ancillary_data do Socket::AncillaryData.new(:INET, :SOCKET, :RIGHTS, '').type.should == Socket::SCM_RIGHTS end - platform_is_not :"solaris2.10", :aix do + platform_is_not :aix do it 'sets the type to SCM_TIMESTAMP when using :TIMESTAMP as the type argument' do Socket::AncillaryData.new(:INET, :SOCKET, :TIMESTAMP, '').type.should == Socket::SCM_TIMESTAMP end end it 'raises TypeError when using a numeric string as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :IGMP, Socket::SCM_RIGHTS.to_s, '') - }.should raise_error(TypeError) + }.should.raise(TypeError) end it 'raises SocketError when using :RECVTTL as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :SOCKET, :RECVTTL, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :MOO as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :SOCKET, :MOO, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :IP_RECVTTL as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :SOCKET, :IP_RECVTTL, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end @@ -155,15 +155,15 @@ with_feature :ancillary_data do end it 'raises SocketError when using :RIGHTS as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :IP, :RIGHTS, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :MOO as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :IP, :MOO, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end @@ -179,15 +179,15 @@ with_feature :ancillary_data do end it 'raises SocketError when using :RIGHTS as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :IPV6, :RIGHTS, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :MOO as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :IPV6, :MOO, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end @@ -205,15 +205,15 @@ with_feature :ancillary_data do end it 'raises SocketError when using :RIGHTS as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :TCP, :RIGHTS, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :MOO as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :TCP, :MOO, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end @@ -225,15 +225,15 @@ with_feature :ancillary_data do end it 'raises SocketError when using :RIGHTS as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :UDP, :RIGHTS, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end it 'raises SocketError when using :MOO as the type argument' do - lambda { + -> { Socket::AncillaryData.new(:INET, :UDP, :MOO, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end @@ -243,41 +243,41 @@ with_feature :ancillary_data do end it 'raises SocketError when using :CORK sa the type argument' do - lambda { + -> { Socket::AncillaryData.new(:UNIX, :SOCKET, :CORK, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end describe 'using :AF_UNIX as the family and :IP as the level' do it 'raises SocketError' do - lambda { + -> { Socket::AncillaryData.new(:UNIX, :IP, :RECVTTL, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end describe 'using :AF_UNIX as the family and :IPV6 as the level' do it 'raises SocketError' do - lambda { + -> { Socket::AncillaryData.new(:UNIX, :IPV6, :NEXTHOP, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end describe 'using :AF_UNIX as the family and :TCP as the level' do it 'raises SocketError' do - lambda { + -> { Socket::AncillaryData.new(:UNIX, :TCP, :CORK, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end describe 'using :AF_UNIX as the family and :UDP as the level' do it 'raises SocketError' do - lambda { + -> { Socket::AncillaryData.new(:UNIX, :UDP, :CORK, '') - }.should raise_error(SocketError) + }.should.raise(SocketError) end end end diff --git a/spec/ruby/library/socket/ancillarydata/int_spec.rb b/spec/ruby/library/socket/ancillarydata/int_spec.rb index 0d7c5e3652..10c5dea436 100644 --- a/spec/ruby/library/socket/ancillarydata/int_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/int_spec.rb @@ -7,7 +7,7 @@ with_feature :ancillary_data do end it 'returns a Socket::AncillaryData' do - @data.should be_an_instance_of(Socket::AncillaryData) + @data.should.instance_of?(Socket::AncillaryData) end it 'sets the family to AF_INET' do @@ -37,7 +37,7 @@ with_feature :ancillary_data do it 'raises when the data is not an Integer' do data = Socket::AncillaryData.new(:UNIX, :SOCKET, :RIGHTS, 'ugh') - lambda { data.int }.should raise_error(TypeError) + -> { data.int }.should.raise(TypeError) end end end diff --git a/spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb b/spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb index 9fc4e8c201..065bcf1f39 100644 --- a/spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb @@ -8,7 +8,7 @@ with_feature :ancillary_data, :pktinfo do end it 'returns a Socket::AncillaryData' do - @data.should be_an_instance_of(Socket::AncillaryData) + @data.should.instance_of?(Socket::AncillaryData) end it 'sets the family to AF_INET' do @@ -32,7 +32,7 @@ with_feature :ancillary_data, :pktinfo do end it 'returns a Socket::AncillaryData' do - @data.should be_an_instance_of(Socket::AncillaryData) + @data.should.instance_of?(Socket::AncillaryData) end it 'sets the family to AF_INET' do @@ -58,7 +58,7 @@ with_feature :ancillary_data, :pktinfo do end it 'returns an Array' do - @data.ip_pktinfo.should be_an_instance_of(Array) + @data.ip_pktinfo.should.instance_of?(Array) end describe 'the returned Array' do @@ -67,15 +67,15 @@ with_feature :ancillary_data, :pktinfo do end it 'stores an Addrinfo at index 0' do - @info[0].should be_an_instance_of(Addrinfo) + @info[0].should.instance_of?(Addrinfo) end it 'stores the ifindex at index 1' do - @info[1].should be_kind_of(Integer) + @info[1].should.is_a?(Integer) end it 'stores an Addrinfo at index 2' do - @info[2].should be_an_instance_of(Addrinfo) + @info[2].should.instance_of?(Addrinfo) end end diff --git a/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb b/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb index f70fe27d6a..7c630218d1 100644 --- a/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb @@ -5,7 +5,7 @@ with_feature :ancillary_data, :ipv6_pktinfo do it 'returns an Addrinfo' do data = Socket::AncillaryData.ipv6_pktinfo(Addrinfo.ip('::1'), 4) - data.ipv6_pktinfo_addr.should be_an_instance_of(Addrinfo) + data.ipv6_pktinfo_addr.should.instance_of?(Addrinfo) end end end diff --git a/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb b/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb index 6f576f5169..b5b779c36e 100644 --- a/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb @@ -7,7 +7,7 @@ with_feature :ancillary_data, :ipv6_pktinfo do end it 'returns a Socket::AncillaryData' do - @data.should be_an_instance_of(Socket::AncillaryData) + @data.should.instance_of?(Socket::AncillaryData) end it 'sets the family to AF_INET' do @@ -31,7 +31,7 @@ with_feature :ancillary_data, :ipv6_pktinfo do end it 'returns an Array' do - @data.ipv6_pktinfo.should be_an_instance_of(Array) + @data.ipv6_pktinfo.should.instance_of?(Array) end describe 'the returned Array' do @@ -40,11 +40,11 @@ with_feature :ancillary_data, :ipv6_pktinfo do end it 'stores an Addrinfo at index 0' do - @info[0].should be_an_instance_of(Addrinfo) + @info[0].should.instance_of?(Addrinfo) end it 'stores the ifindex at index 1' do - @info[1].should be_kind_of(Integer) + @info[1].should.is_a?(Integer) end end diff --git a/spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb b/spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb index 34d954af81..6dd144ba5a 100644 --- a/spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb +++ b/spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb @@ -26,7 +26,7 @@ with_feature :ancillary_data do describe 'using non IO objects' do it 'raises TypeError' do - lambda { Socket::AncillaryData.unix_rights(10) }.should raise_error(TypeError) + -> { Socket::AncillaryData.unix_rights(10) }.should.raise(TypeError) end end end @@ -41,20 +41,20 @@ with_feature :ancillary_data do it 'returns nil when the data is not a list of file descriptors' do data = Socket::AncillaryData.new(:UNIX, :SOCKET, :RIGHTS, '') - data.unix_rights.should be_nil + data.unix_rights.should == nil end it 'raises TypeError when the level is not SOL_SOCKET' do data = Socket::AncillaryData.new(:INET, :IP, :RECVTTL, '') - lambda { data.unix_rights }.should raise_error(TypeError) + -> { data.unix_rights }.should.raise(TypeError) end - platform_is_not :"solaris2.10", :aix do + platform_is_not :aix do it 'raises TypeError when the type is not SCM_RIGHTS' do data = Socket::AncillaryData.new(:INET, :SOCKET, :TIMESTAMP, '') - lambda { data.unix_rights }.should raise_error(TypeError) + -> { data.unix_rights }.should.raise(TypeError) end end end |
