about summary refs log tree commit homepage
path: root/test/test_unix_connect.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2010-09-27 00:11:43 +0000
committerEric Wong <e@yhbt.net>2010-09-27 00:11:43 +0000
commit6fbde1518578dd1b828efcecaf2caf893bddc110 (patch)
tree75261028e9d6c1644eacfd1e5ad881d08a4ea2bd /test/test_unix_connect.rb
parentfdfecc6d815bab8dfc1d8ad6758a66d44ab51e31 (diff)
downloadkgio-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.rb17
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)