summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/constants
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/constants
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/constants')
-rw-r--r--spec/ruby/library/socket/constants/constants_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/ruby/library/socket/constants/constants_spec.rb b/spec/ruby/library/socket/constants/constants_spec.rb
index 2d44636abd..2a218c7c5d 100644
--- a/spec/ruby/library/socket/constants/constants_spec.rb
+++ b/spec/ruby/library/socket/constants/constants_spec.rb
@@ -89,11 +89,22 @@ describe "Socket::Constants" do
platform_is_not :windows do
it 'defines SCM options' do
- Socket::Constants.should have_constant('SCM_CREDENTIALS')
+ platform_is :freebsd do
+ Socket::Constants.should have_constant('SCM_CREDS')
+ end
+ platform_is_not :freebsd do
+ Socket::Constants.should have_constant('SCM_CREDENTIALS')
+ end
end
it 'defines error options' do
consts = ["EAI_ADDRFAMILY", "EAI_NODATA"]
+
+ # FreeBSD (11.1, at least) obsoletes EAI_ADDRFAMILY and EAI_NODATA
+ platform_is :freebsd do
+ consts = %w(EAI_MEMORY)
+ end
+
consts.each do |c|
Socket::Constants.should have_constant(c)
end