ruby-changes:53118
From: nobu <ko1@a...>
Date: Tue, 23 Oct 2018 23:58:15 +0900 (JST)
Subject: [ruby-changes:53118] nobu:r65332 (trunk): getifaddrs_spec.rb: allow no address
nobu 2018-10-23 23:58:08 +0900 (Tue, 23 Oct 2018) New Revision: 65332 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65332 Log: getifaddrs_spec.rb: allow no address * spec/ruby/library/socket/socket/getifaddrs_spec.rb: allow no address for platform dependent failures. https://travis-ci.org/ruby/ruby/jobs/445126982#L2234-L2244 Modified files: trunk/spec/ruby/library/socket/socket/getifaddrs_spec.rb Index: spec/ruby/library/socket/socket/getifaddrs_spec.rb =================================================================== --- spec/ruby/library/socket/socket/getifaddrs_spec.rb (revision 65331) +++ spec/ruby/library/socket/socket/getifaddrs_spec.rb (revision 65332) @@ -48,16 +48,16 @@ describe 'Socket.getifaddrs' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/getifaddrs_spec.rb#L48 end it 'is an Addrinfo' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.should be_an_instance_of(Addrinfo) - end + end.should be_true end it 'has an address family' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.afamily.should be_kind_of(Integer) addr.afamily.should_not == Socket::AF_UNSPEC - end + end.should be_true end end @@ -68,16 +68,16 @@ describe 'Socket.getifaddrs' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/getifaddrs_spec.rb#L68 end it 'is an Addrinfo' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.should be_an_instance_of(Addrinfo) - end + end.should be_true end it 'has an address family' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.afamily.should be_kind_of(Integer) addr.afamily.should_not == Socket::AF_UNSPEC - end + end.should be_true end end @@ -87,22 +87,22 @@ describe 'Socket.getifaddrs' do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/socket/socket/getifaddrs_spec.rb#L87 end it 'is an Addrinfo' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.should be_an_instance_of(Addrinfo) - end + end.should be_true end it 'has an address family' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.afamily.should be_kind_of(Integer) addr.afamily.should_not == Socket::AF_UNSPEC - end + end.should be_true end it 'has an IP address' do - @addrs.each do |addr| + @addrs.all? do |addr| addr.ip_address.should be_an_instance_of(String) - end + end.should be_true end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/