summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/ancillarydata/initialize_spec.rb')
-rw-r--r--spec/ruby/library/socket/ancillarydata/initialize_spec.rb76
1 files changed, 39 insertions, 37 deletions
diff --git a/spec/ruby/library/socket/ancillarydata/initialize_spec.rb b/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
index 659a29e24a..60f5ac7a90 100644
--- a/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
+++ b/spec/ruby/library/socket/ancillarydata/initialize_spec.rb
@@ -2,7 +2,7 @@ require_relative '../spec_helper'
with_feature :ancillary_data do
describe 'Socket::AncillaryData#initialize' do
- describe 'using Fixnums for the family, level, and type' do
+ describe 'using Integers for the family, level, and type' do
before do
@data = Socket::AncillaryData
.new(Socket::AF_INET, Socket::IPPROTO_IP, Socket::IP_RECVTTL, 'ugh')
@@ -106,32 +106,34 @@ with_feature :ancillary_data do
Socket::AncillaryData.new(:INET, :SOCKET, :RIGHTS, '').type.should == Socket::SCM_RIGHTS
end
- 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
+ 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
@@ -153,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
@@ -177,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
@@ -203,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
@@ -223,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
@@ -241,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