From ba6604f00a6fad2c8bf32808928942c37b1617af Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Mon, 9 Sep 2013 22:03:58 +0300 Subject: Add setup and teardown for ipv6 tests Signed-off-by: Eric Wong --- test/test_linux_ipv6.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_linux_ipv6.rb b/test/test_linux_ipv6.rb index ec08f28..9e8730a 100644 --- a/test/test_linux_ipv6.rb +++ b/test/test_linux_ipv6.rb @@ -12,6 +12,14 @@ class TestLinuxIPv6 < Test::Unit::TestCase TEST_ADDR = ENV["TEST_HOST6"] || "::1" + def setup + @to_close = [] + end + + def teardown + @to_close.each { |io| io.close unless io.closed? } + end + def test_tcp s = TCPServer.new(TEST_ADDR, 0) port = s.addr[1] -- cgit v1.2.3-24-ge0c7