diff --git a/spec/ruby/library/socket/addrinfo/foreach_spec.rb b/spec/ruby/library/socket/addrinfo/foreach_spec.rb index 75c1d1dea2..6ec8fab905 100644 --- a/spec/ruby/library/socket/addrinfo/foreach_spec.rb +++ b/spec/ruby/library/socket/addrinfo/foreach_spec.rb @@ -2,7 +2,7 @@ require_relative '../spec_helper' describe 'Addrinfo.foreach' do it 'yields Addrinfo instances to the supplied block' do - Addrinfo.foreach('localhost', 80) do |addr| + Addrinfo.foreach('127.0.0.1', 80) do |addr| addr.should be_an_instance_of(Addrinfo) end end diff --git a/spec/ruby/library/socket/addrinfo/getaddrinfo_spec.rb b/spec/ruby/library/socket/addrinfo/getaddrinfo_spec.rb index ae6d527ac8..67fad73815 100644 --- a/spec/ruby/library/socket/addrinfo/getaddrinfo_spec.rb +++ b/spec/ruby/library/socket/addrinfo/getaddrinfo_spec.rb @@ -2,13 +2,11 @@ require_relative '../spec_helper' require_relative '../fixtures/classes' describe 'Addrinfo.getaddrinfo' do - platform_is_not :solaris do - it 'returns an Array of Addrinfo instances' do - array = Addrinfo.getaddrinfo('localhost', 80) + it 'returns an Array of Addrinfo instances' do + array = Addrinfo.getaddrinfo('127.0.0.1', 80) - array.should be_an_instance_of(Array) - array[0].should be_an_instance_of(Addrinfo) - end + array.should be_an_instance_of(Array) + array[0].should be_an_instance_of(Addrinfo) end SocketSpecs.each_ip_protocol do |family, ip_address| @@ -51,9 +49,9 @@ describe 'Addrinfo.getaddrinfo' do end end - platform_is_not :solaris, :windows do + platform_is_not :windows do it 'sets the default socket type of the Addrinfo instances' do - array = Addrinfo.getaddrinfo('localhost', 80) + array = Addrinfo.getaddrinfo('127.0.0.1', 80) possible = [Socket::SOCK_STREAM, Socket::SOCK_DGRAM] possible.should include(array[0].socktype) @@ -61,14 +59,14 @@ describe 'Addrinfo.getaddrinfo' do end it 'sets a custom socket type of the Addrinfo instances' do - array = Addrinfo.getaddrinfo('localhost', 80, nil, Socket::SOCK_DGRAM) + array = Addrinfo.getaddrinfo('127.0.0.1', 80, nil, Socket::SOCK_DGRAM) array[0].socktype.should == Socket::SOCK_DGRAM end - platform_is_not :solaris, :windows do + platform_is_not :windows do it 'sets the default socket protocol of the Addrinfo instances' do - array = Addrinfo.getaddrinfo('localhost', 80) + array = Addrinfo.getaddrinfo('127.0.0.1', 80) possible = [Socket::IPPROTO_TCP, Socket::IPPROTO_UDP] possible.should include(array[0].protocol) @@ -77,7 +75,7 @@ describe 'Addrinfo.getaddrinfo' do platform_is_not :'solaris2.10' do # i386-solaris it 'sets a custom socket protocol of the Addrinfo instances' do - array = Addrinfo.getaddrinfo('localhost', 80, nil, nil, Socket::IPPROTO_UDP) + array = Addrinfo.getaddrinfo('127.0.0.1', 80, nil, nil, Socket::IPPROTO_UDP) array[0].protocol.should == Socket::IPPROTO_UDP end @@ -85,8 +83,7 @@ describe 'Addrinfo.getaddrinfo' do platform_is_not :solaris do it 'sets the canonical name when AI_CANONNAME is given as a flag' do - array = Addrinfo - .getaddrinfo('localhost', 80, nil, nil, nil, Socket::AI_CANONNAME) + array = Addrinfo.getaddrinfo('localhost', 80, nil, nil, nil, Socket::AI_CANONNAME) array[0].canonname.should be_an_instance_of(String) end