summaryrefslogtreecommitdiff
path: root/tests/white-box/dummy.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-12-27 02:43:24 -0800
committerelijah <elijah@riseup.net>2013-12-27 02:43:24 -0800
commit34678e895a5a40da6f444199983fee3f8ce518ee (patch)
treebe92fdc1efa49ea177fcaf7632166087ac61f762 /tests/white-box/dummy.rb
parentbf385beb22b7a17899604c21b764d84de55b23a8 (diff)
added some network tests for stunnel
Diffstat (limited to 'tests/white-box/dummy.rb')
-rw-r--r--tests/white-box/dummy.rb24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/white-box/dummy.rb b/tests/white-box/dummy.rb
index dd343769..6ca49754 100644
--- a/tests/white-box/dummy.rb
+++ b/tests/white-box/dummy.rb
@@ -26,8 +26,8 @@ class TestDummy < LeapTest
pass
end
- def test_blah
- fail "blah" #assert false
+ def test_fail
+ fail "fail"
pass
end
@@ -36,8 +36,24 @@ class TestDummy < LeapTest
pass
end
- def test_err
- 12/0
+ def test_socket_failure
+ assert_tcp_socket('localhost', 900000)
+ pass
+ end
+
+ def test_socket_success
+ fork {
+ Socket.tcp_server_loop('localhost', 12345) do |sock, client_addrinfo|
+ begin
+ sock.write('hi')
+ ensure
+ sock.close
+ exit
+ end
+ end
+ }
+ sleep 0.2
+ assert_tcp_socket('localhost', 12345)
pass
end