about summary refs log tree commit homepage
path: root/test/test_accept_class.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2010-12-25 22:44:53 +0000
committerEric Wong <e@yhbt.net>2010-12-25 22:46:55 +0000
commitb859c4a12905cbd71d19cde2aaa9f88ec0374cc5 (patch)
tree9c6ae8e68de32b255c628f9ea2cfaec5b18392af /test/test_accept_class.rb
parentef069ece624906b3946248421620d8458bcef605 (diff)
downloadkgio-b859c4a12905cbd71d19cde2aaa9f88ec0374cc5.tar.gz
This is preferred as we no longer have to rely on a global
constant.
Diffstat (limited to 'test/test_accept_class.rb')
-rw-r--r--test/test_accept_class.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_accept_class.rb b/test/test_accept_class.rb
index 3b5d343..cf59a2f 100644
--- a/test/test_accept_class.rb
+++ b/test/test_accept_class.rb
@@ -4,6 +4,9 @@ $-w = true
 require 'kgio'
 
 class TestAcceptClass < Test::Unit::TestCase
+  class FooSocket < Kgio::Socket
+  end
+
   def setup
     assert_equal Kgio::Socket, Kgio.accept_class
   end
@@ -48,5 +51,12 @@ class TestAcceptClass < Test::Unit::TestCase
     client = TCPSocket.new(@host, @port)
     IO.select([@srv])
     assert_instance_of Kgio::UNIXSocket, @srv.kgio_tryaccept
+
+    client = TCPSocket.new(@host, @port)
+    assert_instance_of FooSocket, @srv.kgio_accept(FooSocket)
+
+    client = TCPSocket.new(@host, @port)
+    IO.select([@srv])
+    assert_instance_of FooSocket, @srv.kgio_tryaccept(FooSocket)
   end
 end