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_http_parser_ng.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'test/unit/test_http_parser_ng.rb') diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb index a5ee053..93c44bb 100644 --- a/test/unit/test_http_parser_ng.rb +++ b/test/unit/test_http_parser_ng.rb @@ -34,7 +34,7 @@ class HttpParserNgTest < Test::Unit::TestCase def test_connection_TE @parser.buf << "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: TE\r\n" @parser.buf << "TE: trailers\r\n\r\n" - assert_nothing_raised { @parser.parse } + @parser.parse assert @parser.keepalive? assert @parser.next? end @@ -94,10 +94,8 @@ class HttpParserNgTest < Test::Unit::TestCase def test_default_keepalive_is_off assert ! @parser.keepalive? assert ! @parser.next? - assert_nothing_raised do - @parser.buf << "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n" - @parser.parse - end + @parser.buf << "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n" + @parser.parse assert @parser.keepalive? @parser.clear assert ! @parser.keepalive? @@ -419,7 +417,7 @@ class HttpParserNgTest < Test::Unit::TestCase req = @parser.env assert_equal req, @parser.parse assert_nil @parser.content_length - assert_nothing_raised { @parser.filter_body('', str) } + @parser.filter_body('', str) assert ! @parser.keepalive? end @@ -427,7 +425,7 @@ class HttpParserNgTest < Test::Unit::TestCase n = HttpParser::LENGTH_MAX @parser.buf << "PUT / HTTP/1.1\r\nContent-Length: #{n}\r\n\r\n" req = @parser.env - assert_nothing_raised { @parser.headers(req, @parser.buf) } + @parser.headers(req, @parser.buf) assert_equal n, req['CONTENT_LENGTH'].to_i assert ! @parser.keepalive? end -- cgit v1.2.3-24-ge0c7