diff --git a/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb index c9c703058c..951574abc5 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb @@ -2,11 +2,13 @@ require_relative '../spec_helper' guard -> { SocketSpecs.ipv6_available? } do describe 'Addrinfo#ipv6_linklocal?' do - it 'returns true for a link-local address' do - Addrinfo.ip('fe80::').ipv6_linklocal?.should == true - Addrinfo.ip('fe81::').ipv6_linklocal?.should == true - Addrinfo.ip('fe8f::').ipv6_linklocal?.should == true - Addrinfo.ip('fe80::1').ipv6_linklocal?.should == true + platform_is_not :aix do + it 'returns true for a link-local address' do + Addrinfo.ip('fe80::').ipv6_linklocal?.should == true + Addrinfo.ip('fe81::').ipv6_linklocal?.should == true + Addrinfo.ip('fe8f::').ipv6_linklocal?.should == true + Addrinfo.ip('fe80::1').ipv6_linklocal?.should == true + end end it 'returns false for a regular address' do diff --git a/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb index 14ed6688a1..58e9f133f3 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb @@ -2,11 +2,13 @@ require_relative '../spec_helper' guard -> { SocketSpecs.ipv6_available? } do describe 'Addrinfo#ipv6_sitelocal?' do - it 'returns true for a site-local address' do - Addrinfo.ip('feef::').ipv6_sitelocal?.should == true - Addrinfo.ip('fee0::').ipv6_sitelocal?.should == true - Addrinfo.ip('fee2::').ipv6_sitelocal?.should == true - Addrinfo.ip('feef::1').ipv6_sitelocal?.should == true + platform_is_not :aix do + it 'returns true for a site-local address' do + Addrinfo.ip('feef::').ipv6_sitelocal?.should == true + Addrinfo.ip('fee0::').ipv6_sitelocal?.should == true + Addrinfo.ip('fee2::').ipv6_sitelocal?.should == true + Addrinfo.ip('feef::1').ipv6_sitelocal?.should == true + end end it 'returns false for a regular IPv6 address' do diff --git a/spec/ruby/library/socket/addrinfo/ipv6_to_ipv4_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_to_ipv4_spec.rb index 2f031ddde0..5d3d69f08d 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_to_ipv4_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_to_ipv4_spec.rb @@ -11,31 +11,33 @@ guard -> { SocketSpecs.ipv6_available? } do addr.ip_address.should == '192.168.1.1' end - it 'returns an Addrinfo for ::0.0.1.1' do - addr = Addrinfo.ip('::0.0.1.1').ipv6_to_ipv4 + platform_is_not :aix do + it 'returns an Addrinfo for ::0.0.1.1' do + addr = Addrinfo.ip('::0.0.1.1').ipv6_to_ipv4 - addr.should be_an_instance_of(Addrinfo) + addr.should be_an_instance_of(Addrinfo) - addr.afamily.should == Socket::AF_INET - addr.ip_address.should == '0.0.1.1' - end + addr.afamily.should == Socket::AF_INET + addr.ip_address.should == '0.0.1.1' + end - it 'returns an Addrinfo for ::0.0.1.0' do - addr = Addrinfo.ip('::0.0.1.0').ipv6_to_ipv4 + it 'returns an Addrinfo for ::0.0.1.0' do + addr = Addrinfo.ip('::0.0.1.0').ipv6_to_ipv4 - addr.should be_an_instance_of(Addrinfo) + addr.should be_an_instance_of(Addrinfo) - addr.afamily.should == Socket::AF_INET - addr.ip_address.should == '0.0.1.0' - end + addr.afamily.should == Socket::AF_INET + addr.ip_address.should == '0.0.1.0' + end - it 'returns an Addrinfo for ::0.1.0.0' do - addr = Addrinfo.ip('::0.1.0.0').ipv6_to_ipv4 + it 'returns an Addrinfo for ::0.1.0.0' do + addr = Addrinfo.ip('::0.1.0.0').ipv6_to_ipv4 - addr.should be_an_instance_of(Addrinfo) + addr.should be_an_instance_of(Addrinfo) - addr.afamily.should == Socket::AF_INET - addr.ip_address.should == '0.1.0.0' + addr.afamily.should == Socket::AF_INET + addr.ip_address.should == '0.1.0.0' + end end it 'returns an Addrinfo for ::ffff:192.168.1.1' do diff --git a/spec/ruby/library/socket/basicsocket/connect_address_spec.rb b/spec/ruby/library/socket/basicsocket/connect_address_spec.rb index 03e456b620..18baac7f17 100644 --- a/spec/ruby/library/socket/basicsocket/connect_address_spec.rb +++ b/spec/ruby/library/socket/basicsocket/connect_address_spec.rb @@ -95,21 +95,23 @@ describe 'Socket#connect_address' do end with_feature :unix_socket do - describe 'using an unbound UNIX socket' do - before do - @path = SocketSpecs.socket_path - @server = UNIXServer.new(@path) - @client = UNIXSocket.new(@path) - end + platform_is_not :aix do + describe 'using an unbound UNIX socket' do + before do + @path = SocketSpecs.socket_path + @server = UNIXServer.new(@path) + @client = UNIXSocket.new(@path) + end - after do - @client.close - @server.close - rm_r(@path) - end + after do + @client.close + @server.close + rm_r(@path) + end - it 'raises SocketError' do - lambda { @client.connect_address }.should raise_error(SocketError) + it 'raises SocketError' do + lambda { @client.connect_address }.should raise_error(SocketError) + end end end diff --git a/spec/ruby/library/socket/socket/gethostbyaddr_spec.rb b/spec/ruby/library/socket/socket/gethostbyaddr_spec.rb index b5f5942668..08cadcf93b 100644 --- a/spec/ruby/library/socket/socket/gethostbyaddr_spec.rb +++ b/spec/ruby/library/socket/socket/gethostbyaddr_spec.rb @@ -62,7 +62,7 @@ describe 'Socket.gethostbyaddr' do end end - guard -> { SocketSpecs.ipv6_available? } do + guard -> { SocketSpecs.ipv6_available? && platform_is_not(:aix) } do describe 'using an IPv6 address' do before do @addr = IPAddr.new('::1').hton diff --git a/spec/ruby/library/socket/unixsocket/local_address_spec.rb b/spec/ruby/library/socket/unixsocket/local_address_spec.rb index 8c77519830..56b3ccc557 100644 --- a/spec/ruby/library/socket/unixsocket/local_address_spec.rb +++ b/spec/ruby/library/socket/unixsocket/local_address_spec.rb @@ -21,20 +21,24 @@ with_feature :unix_socket do end describe 'the returned Addrinfo' do - it 'uses AF_UNIX as the address family' do - @client.local_address.afamily.should == Socket::AF_UNIX - end + platform_is_not :aix do + it 'uses AF_UNIX as the address family' do + @client.local_address.afamily.should == Socket::AF_UNIX + end - it 'uses PF_UNIX as the protocol family' do - @client.local_address.pfamily.should == Socket::PF_UNIX + it 'uses PF_UNIX as the protocol family' do + @client.local_address.pfamily.should == Socket::PF_UNIX + end end it 'uses SOCK_STREAM as the socket type' do @client.local_address.socktype.should == Socket::SOCK_STREAM end - it 'uses an empty socket path' do - @client.local_address.unix_path.should == '' + platform_is_not :aix do + it 'uses an empty socket path' do + @client.local_address.unix_path.should == '' + end end it 'uses 0 as the protocol' do