0

在 ruby​​ 代码段失败后,删除此代码段未显示任何错误。我看到已关闭的问题https://bugs.ruby-lang.org/issues/15067,它们是否相同。此代码段上的任何输入都将非常有用。

platform_is_not :windows do
        describe 'using NI_NUMERICHOST as the flag' do
          it 'returns an Array containing the numeric hostname and service name' do
            Socket.getnameinfo(@addr, Socket::NI_NUMERICHOST).should == [ip_address, 'ftp']
          end
        end
      end

有错误

Socket.getnameinfo using IPv4 using a 3 element Array as the first argument using NI_NUMERICHOST as the flag returns an Array containing the numeric hostname and service name ERROR
SocketError: sockaddr resolved to multiple nodename
/home/travis/build/alpha/ruby/spec/ruby/library/socket/socket/getnameinfo_spec.rb:111:in `getnameinfo'
/home/travis/build/alpha/ruby/spec/ruby/library/socket/socket/getnameinfo_spec.rb:111:in `block (6 levels) in <top (required)>'
/home/travis/build/alpha/ruby/spec/ruby/library/socket/socket/getnameinfo_spec.rb:65:in `<top (required)>'
4

0 回答 0