summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/addrinfo
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-02-13 23:10:03 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-02-13 23:10:03 +0900
commitdb8c8c0916c5e0feaad5767ac7cd3fe30b86e964 (patch)
tree965c209bd955b68a55d9380b638788f1ed5f37a9 /spec/ruby/library/socket/addrinfo
parent89bfad17d5911b7295063b85e9c003e2a837493a (diff)
spec/ruby/library/socket/addrinfo: skip the specs that uses SOCK_SEQPACKET on Android
SOCK_SEQPACKET seems not to be supported on Android
Diffstat (limited to 'spec/ruby/library/socket/addrinfo')
-rw-r--r--spec/ruby/library/socket/addrinfo/initialize_spec.rb50
1 files changed, 27 insertions, 23 deletions
diff --git a/spec/ruby/library/socket/addrinfo/initialize_spec.rb b/spec/ruby/library/socket/addrinfo/initialize_spec.rb
index 8354553f61..00250439fd 100644
--- a/spec/ruby/library/socket/addrinfo/initialize_spec.rb
+++ b/spec/ruby/library/socket/addrinfo/initialize_spec.rb
@@ -274,15 +274,17 @@ describe "Addrinfo#initialize" do
end
end
- with_feature :sock_packet do
- [:SOCK_SEQPACKET].each do |type|
- it "overwrites the socket type #{type}" do
- sockaddr = ['AF_INET', 80, 'hostname', '127.0.0.1']
+ platform_is_not :android do
+ with_feature :sock_packet do
+ [:SOCK_SEQPACKET].each do |type|
+ it "overwrites the socket type #{type}" do
+ sockaddr = ['AF_INET', 80, 'hostname', '127.0.0.1']
- value = Socket.const_get(type)
- addr = Addrinfo.new(sockaddr, nil, value)
+ value = Socket.const_get(type)
+ addr = Addrinfo.new(sockaddr, nil, value)
- addr.socktype.should == value
+ addr.socktype.should == value
+ end
end
end
end
@@ -448,28 +450,30 @@ describe "Addrinfo#initialize" do
end
platform_is :linux do
- describe 'and the socket type is set to SOCK_SEQPACKET' do
- before do
- @socktype = Socket::SOCK_SEQPACKET
- end
+ platform_is_not :android do
+ describe 'and the socket type is set to SOCK_SEQPACKET' do
+ before do
+ @socktype = Socket::SOCK_SEQPACKET
+ end
- valid = [:IPPROTO_IP, :IPPROTO_HOPOPTS]
+ valid = [:IPPROTO_IP, :IPPROTO_HOPOPTS]
- valid.each do |type|
- it "overwrites the protocol when using #{type}" do
- value = Socket.const_get(type)
- addr = Addrinfo.new(@sockaddr, nil, @socktype, value)
+ valid.each do |type|
+ it "overwrites the protocol when using #{type}" do
+ value = Socket.const_get(type)
+ addr = Addrinfo.new(@sockaddr, nil, @socktype, value)
- addr.protocol.should == value
+ addr.protocol.should == value
+ end
end
- end
- (Socket.constants.grep(/^IPPROTO/) - valid).each do |type|
- it "raises SocketError when using #{type}" do
- value = Socket.const_get(type)
- block = -> { Addrinfo.new(@sockaddr, nil, @socktype, value) }
+ (Socket.constants.grep(/^IPPROTO/) - valid).each do |type|
+ it "raises SocketError when using #{type}" do
+ value = Socket.const_get(type)
+ block = -> { Addrinfo.new(@sockaddr, nil, @socktype, value) }
- block.should raise_error(SocketError)
+ block.should raise_error(SocketError)
+ end
end
end
end