summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/tcpserver/initialize_spec.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-09 03:32:51 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-09 03:32:51 +0000
commitab8791d7d27c0b266506785ca11587d627e5465a (patch)
treeee89ae73af7ae351bf365adcfd4bebae8fc83e1f /spec/ruby/library/socket/tcpserver/initialize_spec.rb
parent52102f6ff50eebf8c16667c9b49cef579d2057c1 (diff)
spec/ruby/library/socket/*: more FreeBSD fixes
FreeBSD portability notes: Loopback connections are not instantaneous (unlike Linux), so non-blocking read-after-write MUST check for readability via IO.select or IO#wait_readable before attempting non-blocking recv/read operations. IPv6 seems favored, so we'll get "::" instead of "0.0.0.0" Some constants are different or obsolete, so that should be self-explanatory. There are still other failures I or somebody else needs to get to when we have time and feel like dealing with spec DSL: http://rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/recent.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/socket/tcpserver/initialize_spec.rb')
-rw-r--r--spec/ruby/library/socket/tcpserver/initialize_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/ruby/library/socket/tcpserver/initialize_spec.rb b/spec/ruby/library/socket/tcpserver/initialize_spec.rb
index 2de8c764b2..9a55cf17e2 100644
--- a/spec/ruby/library/socket/tcpserver/initialize_spec.rb
+++ b/spec/ruby/library/socket/tcpserver/initialize_spec.rb
@@ -17,8 +17,9 @@ describe 'TCPServer#initialize' do
end
platform_is_not :windows do
- it 'sets the hostname to 0.0.0.0' do
- @server.local_address.ip_address.should == '0.0.0.0'
+ it 'sets the hostname to 0.0.0.0 or ::' do
+ a = @server.local_address
+ a.ip_address.should == (a.ipv6? ? '::' : '0.0.0.0')
end
end
@@ -42,8 +43,9 @@ describe 'TCPServer#initialize' do
end
platform_is_not :windows do
- it 'sets the hostname to 0.0.0.0' do
- @server.local_address.ip_address.should == '0.0.0.0'
+ it 'sets the hostname to 0.0.0.0 or ::' do
+ a = @server.local_address
+ a.ip_address.should == (a.ipv6? ? '::' : '0.0.0.0')
end
end
end