summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/socket/test_tcp.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index c623c1b58c..cc744709a6 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -18,8 +18,8 @@ assert false, "TODO: doesn't work on mswin32/64" if /mswin/ =~ RUBY_PLATFORM
sock = TCPSocket.open(addr[2], addr[1])
assert_equal(["foo", nil], sock.recvfrom(0x10000))
ensure
- th.kill
- th.join
+ th.kill if th
+ th.join if th
end
def test_encoding
@@ -36,8 +36,8 @@ assert false, "TODO: doesn't work on mswin32/64" if /mswin/ =~ RUBY_PLATFORM
assert_equal("foo\r\n", s)
assert_equal(Encoding.find("ASCII-8BIT"), s.encoding)
ensure
- th.kill
- th.join
+ th.kill if th
+ th.join if th
sock.close if sock
end
end if defined?(TCPSocket)