summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-22 21:04:01 (GMT)
committerJeremy Evans <code@jeremyevans.net>2020-09-22 22:44:34 (GMT)
commited27c2514c2f4140546dce2e8f5f64cb91712c47 (patch)
tree5b7b1deeb891e07a02f6b915ac908ac03ac02c8a
parentb904b72960880833bc1592c7d6918f687d9f8631 (diff)
Update UnixSocket#recv_io tests to handle receiving a UnixSocket
Receiving UnixSocket works fine if you don't provide a mode, and I think it is reasonable to expect that you should not provide a mode if klass.for_fd would not accept a mode. Fixes [Bug #11778]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3566
-rw-r--r--test/socket/test_unix.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index e9c90be..8c74d0c 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -47,10 +47,16 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
r.close
s1.send_io(s1)
- # klass = UNIXSocket FIXME: [ruby-core:71860] [Bug #11778]
+ klass = UNIXSocket
+ r = s2.recv_io(klass)
+ assert_instance_of klass, r, 'recv_io with proper klass'
+ assert_not_equal s1.fileno, r.fileno
+ r.close
+
+ s1.send_io(s1)
klass = IO
r = s2.recv_io(klass, 'r+')
- assert_instance_of klass, r, 'recv_io with proper klass'
+ assert_instance_of klass, r, 'recv_io with proper klass and mode'
assert_not_equal s1.fileno, r.fileno
r.close
end