From 5acf5522295c947d3118926d1a1077007f615de9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Aug 2012 13:34:34 -0700 Subject: avoid assert_nothing_raised in unit tests It's better to show errors and backtraces when stuff breaks --- test/unit/test_util.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'test/unit/test_util.rb') diff --git a/test/unit/test_util.rb b/test/unit/test_util.rb index 377f6b8..b8e4043 100644 --- a/test/unit/test_util.rb +++ b/test/unit/test_util.rb @@ -18,8 +18,8 @@ class TestUtil < Test::Unit::TestCase assert_equal ext, (fp.external_encoding rescue nil) assert_equal int, (fp.internal_encoding rescue nil) assert_equal(EXPECT_FLAGS, EXPECT_FLAGS & fp.fcntl(Fcntl::F_GETFL)) - assert_nothing_raised { tmp.close! } - assert_nothing_raised { fp.close } + tmp.close! + fp.close end def test_reopen_logs_renamed @@ -43,9 +43,9 @@ class TestUtil < Test::Unit::TestCase assert_equal int, (fp.internal_encoding rescue nil) assert_equal(EXPECT_FLAGS, EXPECT_FLAGS & fp.fcntl(Fcntl::F_GETFL)) assert fp.sync - assert_nothing_raised { tmp.close! } - assert_nothing_raised { to.close! } - assert_nothing_raised { fp.close } + tmp.close! + to.close! + fp.close end def test_reopen_logs_renamed_with_encoding @@ -68,7 +68,7 @@ class TestUtil < Test::Unit::TestCase assert fp.sync } } - assert_nothing_raised { tmp.close! } + tmp.close! end if STDIN.respond_to?(:external_encoding) def test_reopen_logs_renamed_with_internal_encoding @@ -94,7 +94,6 @@ class TestUtil < Test::Unit::TestCase } } } - assert_nothing_raised { tmp.close! } + tmp.close! end if STDIN.respond_to?(:external_encoding) - end -- cgit v1.2.3-24-ge0c7