aboutsummaryrefslogtreecommitdiffstats
path: root/test/socket/test_socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket/test_socket.rb')
-rw-r--r--test/socket/test_socket.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index c436484dde..11d688ba75 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -57,4 +57,18 @@ class TestBasicSocket < Test::Unit::TestCase
}
end
end
+
+ def test_listen
+ s = nil
+ log = Object.new
+ class << log; self end.send(:define_method, :to_int) {
+ s.close
+ 2
+ }
+ inet_stream do |s|
+ assert_raise(IOError) {
+ s.listen(log)
+ }
+ end
+ end
end if defined?(Socket)