summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/ancillarydata
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/ancillarydata')
-rw-r--r--spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb2
-rw-r--r--spec/ruby/library/socket/ancillarydata/initialize_spec.rb36
-rw-r--r--spec/ruby/library/socket/ancillarydata/int_spec.rb4
-rw-r--r--spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb16
-rw-r--r--spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb2
-rw-r--r--spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb10
-rw-r--r--spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb10
7 files changed, 40 insertions, 40 deletions
diff --git a/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb b/spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb
index c54ee29825..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
- -> { @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 344d1485c5..60f5ac7a90 100644
--- a/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
+++ b/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
@@ -106,7 +106,7 @@ 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
@@ -115,25 +115,25 @@ with_feature :ancillary_data do
it 'raises TypeError when using a numeric string as the type argument' do
-> {
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
-> {
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
-> {
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
-> {
Socket::AncillaryData.new(:INET, :SOCKET, :IP_RECVTTL, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -157,13 +157,13 @@ with_feature :ancillary_data do
it 'raises SocketError when using :RIGHTS as the type argument' do
-> {
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
-> {
Socket::AncillaryData.new(:INET, :IP, :MOO, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -181,13 +181,13 @@ with_feature :ancillary_data do
it 'raises SocketError when using :RIGHTS as the type argument' do
-> {
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
-> {
Socket::AncillaryData.new(:INET, :IPV6, :MOO, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -207,13 +207,13 @@ with_feature :ancillary_data do
it 'raises SocketError when using :RIGHTS as the type argument' do
-> {
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
-> {
Socket::AncillaryData.new(:INET, :TCP, :MOO, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -227,13 +227,13 @@ with_feature :ancillary_data do
it 'raises SocketError when using :RIGHTS as the type argument' do
-> {
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
-> {
Socket::AncillaryData.new(:INET, :UDP, :MOO, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -245,7 +245,7 @@ with_feature :ancillary_data do
it 'raises SocketError when using :CORK sa the type argument' do
-> {
Socket::AncillaryData.new(:UNIX, :SOCKET, :CORK, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -253,7 +253,7 @@ with_feature :ancillary_data do
it 'raises SocketError' do
-> {
Socket::AncillaryData.new(:UNIX, :IP, :RECVTTL, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -261,7 +261,7 @@ with_feature :ancillary_data do
it 'raises SocketError' do
-> {
Socket::AncillaryData.new(:UNIX, :IPV6, :NEXTHOP, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -269,7 +269,7 @@ with_feature :ancillary_data do
it 'raises SocketError' do
-> {
Socket::AncillaryData.new(:UNIX, :TCP, :CORK, '')
- }.should raise_error(SocketError)
+ }.should.raise(SocketError)
end
end
@@ -277,7 +277,7 @@ with_feature :ancillary_data do
it 'raises SocketError' do
-> {
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 fe41a30a1a..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')
- -> { 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 84910a038a..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
@@ -89,7 +89,7 @@ with_feature :ancillary_data, :pktinfo do
end
it 'is not the same object as the input Addrinfo' do
- @addr.should_not equal @source
+ @addr.should_not.equal? @source
end
end
@@ -109,7 +109,7 @@ with_feature :ancillary_data, :pktinfo do
end
it 'is not the same object as the input Addrinfo' do
- @addr.should_not equal @dest
+ @addr.should_not.equal? @dest
end
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 0fffc720dc..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
@@ -58,7 +58,7 @@ with_feature :ancillary_data, :ipv6_pktinfo do
end
it 'is not the same object as the input Addrinfo' do
- @addr.should_not equal @source
+ @addr.should_not.equal? @source
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 65ffcb01af..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
- -> { 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, '')
- -> { 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, '')
- -> { data.unix_rights }.should raise_error(TypeError)
+ -> { data.unix_rights }.should.raise(TypeError)
end
end
end