diff options
Diffstat (limited to 'test/test_accept_class.rb')
-rw-r--r-- | test/test_accept_class.rb | 10 |
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 |