From f4af812a28b03508c96853739aea53f7a6714abf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 13 Nov 2012 20:22:13 +0000 Subject: tests: remove assert_nothing_raised (part 2) assert_nothing_raised ends up hiding errors and backtraces, making things harder to debug. Since Test::Unit already fails on uncaught exceptions, there is no need to assert on the lack of exceptions for a successful test run. This is a followup to commit 5acf5522295c947d3118926d1a1077007f615de9 --- test/unit/test_tee_input.rb | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'test/unit/test_tee_input.rb') diff --git a/test/unit/test_tee_input.rb b/test/unit/test_tee_input.rb index 96eb268..0c2c941 100644 --- a/test/unit/test_tee_input.rb +++ b/test/unit/test_tee_input.rb @@ -40,13 +40,13 @@ class TestTeeInput < Test::Unit::TestCase @wr.close } @wr.close - assert_nothing_raised { line = ti.gets } + line = ti.gets assert_equal(4096 * 4 * 3 + 5 + $/.size, line.size) assert_equal("hello" << ("ffff" * 4096 * 3) << "#$/", line) - assert_nothing_raised { line = ti.gets } + line = ti.gets assert_equal "foo#$/", line assert_nil ti.gets - assert_nothing_raised { pid, status = Process.waitpid2(pid) } + pid, status = Process.waitpid2(pid) assert status.success? end @@ -60,12 +60,12 @@ class TestTeeInput < Test::Unit::TestCase @wr.close } @wr.close - assert_nothing_raised { line = ti.gets } + line = ti.gets assert_equal("hello#$/", line) - assert_nothing_raised { line = ti.gets } + line = ti.gets assert_equal "foo", line assert_nil ti.gets - assert_nothing_raised { pid, status = Process.waitpid2(pid) } + pid, status = Process.waitpid2(pid) assert status.success? end @@ -146,8 +146,7 @@ class TestTeeInput < Test::Unit::TestCase assert_equal Unicorn::Const::MAX_BODY + 1, ti.size } assert_nil ti.read(1) - status = nil - assert_nothing_raised { pid, status = Process.waitpid2(pid) } + pid, status = Process.waitpid2(pid) assert status.success? end @@ -174,15 +173,15 @@ class TestTeeInput < Test::Unit::TestCase assert @parser.body_eof? assert_equal 25, ti.len assert_equal 0, ti.tmp.pos - assert_nothing_raised { ti.rewind } + ti.rewind assert_equal 0, ti.tmp.pos assert_equal 'abcdeabcdeabcdeabcde', ti.read(20) assert_equal 20, ti.tmp.pos - assert_nothing_raised { ti.rewind } + ti.rewind assert_equal 0, ti.tmp.pos assert_kind_of File, ti.tmp status = nil - assert_nothing_raised { pid, status = Process.waitpid2(pid) } + pid, status = Process.waitpid2(pid) assert status.success? end @@ -241,8 +240,7 @@ class TestTeeInput < Test::Unit::TestCase assert ! @parser.body_eof? assert_equal 25, ti.size assert_equal "World", @parser.env['HTTP_HELLO'] - status = nil - assert_nothing_raised { pid, status = Process.waitpid2(pid) } + pid, status = Process.waitpid2(pid) assert status.success? end -- cgit v1.2.3-24-ge0c7