diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-29 13:39:58 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-29 13:40:05 -0700 |
commit | 4cae518fd0b2ba81114ed4cc26eb1704a1f71e28 (patch) | |
tree | bacdbf5c3d8dffbeb81db74651742e42e3519618 /test | |
parent | c03045ecde0f3270d7458ba7ac0d76a25afc6fb2 (diff) | |
download | clogger-4cae518fd0b2ba81114ed4cc26eb1704a1f71e28.tar.gz |
Some misbehaved apps can do this to us, and we don't want the C extension to segfault when this happens.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_clogger.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb index c3ae93c..d2121da 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -362,4 +362,15 @@ class TestClogger < Test::Unit::TestCase status, headers, body = cl.call(req) assert_equal "bar h&m\n", str.string end + + def test_bogus_app_response + str = StringIO.new + app = lambda { |env| 302 } + cl = Clogger.new(app, :logger => str) + assert_raise(TypeError) { cl.call(@req) } + str = str.string + e = Regexp.quote " \"GET /hello?goodbye=true HTTP/1.0\" 500 -" + assert_match %r{#{e}$}m, str + end + end |