diff options
author | Benoit Daloze <[email protected]> | 2019-04-28 23:20:11 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-04-28 23:20:11 +0200 |
commit | 79671ec57e59091260a0bc3d40a31d31d9c72a94 (patch) | |
tree | 2f59a8727b8f63f9e79d50352fa4f78a7cc00234 /spec/ruby/library/socket | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/library/socket')
-rw-r--r-- | spec/ruby/library/socket/addrinfo/ip_address_spec.rb | 19 | ||||
-rw-r--r-- | spec/ruby/library/socket/spec_helper.rb | 4 |
2 files changed, 0 insertions, 23 deletions
diff --git a/spec/ruby/library/socket/addrinfo/ip_address_spec.rb b/spec/ruby/library/socket/addrinfo/ip_address_spec.rb index 004de37254..d53c00267a 100644 --- a/spec/ruby/library/socket/addrinfo/ip_address_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ip_address_spec.rb @@ -63,23 +63,4 @@ describe "Addrinfo#ip_address" do @ips.include?(addr.ip_address).should == true end end - - # On MRI calling Addrinfo#ip_address with AF_UNSPEC as the address family is - # supposed to raise a SocketError. MRI however doesn't provide a way to - # actually initialize an Addrinfo with AF_UNSPEC, nor does it allow stubbing - # of any methods since Addrinfo doesn't use any Ruby methods for checking the - # IP address. As a result we can only run this test on Rubinius. - with_feature :pure_ruby_addrinfo do - describe 'with a non IPv4 or IPv6 address' do - it 'raises SocketError' do - sockaddr = Socket.sockaddr_in(80, '127.0.0.1') - addr = Addrinfo.new(sockaddr) - - addr.stub!(:ipv4?).and_return(false) - addr.stub!(:ipv6?).and_return(false) - - lambda { addr.ip_address }.should raise_error(SocketError) - end - end - end end diff --git a/spec/ruby/library/socket/spec_helper.rb b/spec/ruby/library/socket/spec_helper.rb index 8976937ac7..1121542dd5 100644 --- a/spec/ruby/library/socket/spec_helper.rb +++ b/spec/ruby/library/socket/spec_helper.rb @@ -1,10 +1,6 @@ require_relative '../../spec_helper' require 'socket' -if %w[rbx truffleruby].include?(RUBY_ENGINE) - MSpec.enable_feature :pure_ruby_addrinfo -end - MSpec.enable_feature :sock_packet if Socket.const_defined?(:SOCK_PACKET) MSpec.enable_feature :unix_socket unless PlatformGuard.windows? MSpec.enable_feature :udp_cork if Socket.const_defined?(:UDP_CORK) |