diff options
author | Eric Wong <normalperson@yhbt.net> | 2012-11-13 20:22:13 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-11-13 20:22:13 +0000 |
commit | f4af812a28b03508c96853739aea53f7a6714abf (patch) | |
tree | cbfe8ae9ae2a6c228f0176f93ff811030aade122 /test/unit/test_http_parser_ng.rb | |
parent | 4bd0dbdf2d27672dc941746e06b647ea26fe63ee (diff) | |
download | unicorn-f4af812a28b03508c96853739aea53f7a6714abf.tar.gz |
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
Diffstat (limited to 'test/unit/test_http_parser_ng.rb')
-rw-r--r-- | test/unit/test_http_parser_ng.rb | 12 |
1 files changed, 5 insertions, 7 deletions
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 |