diff options
author | Eric Wong <e@yhbt.net> | 2010-12-25 22:44:53 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2010-12-25 22:46:55 +0000 |
commit | b859c4a12905cbd71d19cde2aaa9f88ec0374cc5 (patch) | |
tree | 9c6ae8e68de32b255c628f9ea2cfaec5b18392af /test/test_accept_class.rb | |
parent | ef069ece624906b3946248421620d8458bcef605 (diff) | |
download | kgio-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.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 |