diff options
author | Eric Wong <e@yhbt.net> | 2010-09-27 00:11:43 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2010-09-27 00:11:43 +0000 |
commit | 6fbde1518578dd1b828efcecaf2caf893bddc110 (patch) | |
tree | 75261028e9d6c1644eacfd1e5ad881d08a4ea2bd /test/test_unix_connect.rb | |
parent | fdfecc6d815bab8dfc1d8ad6758a66d44ab51e31 (diff) | |
download | kgio-6fbde1518578dd1b828efcecaf2caf893bddc110.tar.gz |
These initiate (but do not wait for) non-blocking connects.
Diffstat (limited to 'test/test_unix_connect.rb')
-rw-r--r-- | test/test_unix_connect.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_unix_connect.rb b/test/test_unix_connect.rb index 458149d..4b7519c 100644 --- a/test/test_unix_connect.rb +++ b/test/test_unix_connect.rb @@ -48,6 +48,23 @@ class TestKgioUnixConnect < Test::Unit::TestCase assert_equal nil, sock.kgio_write("HELLO") end + def test_start + sock = Kgio::Socket.start(@addr) + assert_instance_of Kgio::Socket, sock + ready = IO.select(nil, [ sock ]) + assert_equal sock, ready[1][0] + assert_equal nil, sock.kgio_write("HELLO") + end + + def test_socket_start + Kgio::wait_writable = :wait_writable + sock = SubSocket.start(@addr) + assert_nil sock.foo + ready = IO.select(nil, [ sock ]) + assert_equal sock, ready[1][0] + assert_equal nil, sock.kgio_write("HELLO") + end + def test_wait_writable_set Kgio::wait_writable = :wait_writable sock = SubSocket.new(@addr) |