summaryrefslogtreecommitdiff
path: root/tests/white-box/dummy.rb
diff options
context:
space:
mode:
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