about summary refs log tree commit homepage
path: root/test/test_clogger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_clogger.rb')
-rw-r--r--test/test_clogger.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb
index 10c587a..9bff918 100644
--- a/test/test_clogger.rb
+++ b/test/test_clogger.rb
@@ -837,4 +837,21 @@ class TestClogger < Test::Unit::TestCase
     expect = "\"GET http://example.com/hello?goodbye=true HTTP/1.0\"\n"
     assert_equal [ expect ], s
   end
+
+  def test_lint_error_wrapper
+    require 'rack/lobster'
+    @req["SERVER_NAME"] = "FOO"
+    @req["SERVER_PORT"] = "666"
+    @req["rack.version"] = [1,1]
+    @req["rack.multithread"] = true
+    @req["rack.multiprocess"] = true
+    @req["rack.run_once"] = false
+    app = Rack::ContentLength.new(Rack::ContentType.new(Rack::Lobster.new))
+    cl = Clogger.new(app, format: :Combined)
+    @req["rack.errors"] = err = StringIO.new
+    status, headers, body = r = Rack::Lint.new(cl).call(@req)
+    body.each { |x| assert_kind_of String, x.to_str }
+    body.close # might raise here
+    assert_match(%r{GET /hello}, err.string)
+  end
 end