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.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb
index f79017b..c3ae93c 100644
--- a/test/test_clogger.rb
+++ b/test/test_clogger.rb
@@ -333,6 +333,22 @@ class TestClogger < Test::Unit::TestCase
     assert_equal expect, str.string
   end
 
+  def test_request_uri_fallback
+    str = StringIO.new
+    app = lambda { |env| [ 200, {}, [] ] }
+    cl = Clogger.new(app, :logger => str, :format => '$request_uri')
+    status, headers, body = cl.call(@req)
+    assert_equal "/hello?goodbye=true\n", str.string
+  end
+
+  def test_request_uri_set
+    str = StringIO.new
+    app = lambda { |env| [ 200, {}, [] ] }
+    cl = Clogger.new(app, :logger => str, :format => '$request_uri')
+    status, headers, body = cl.call(@req.merge("REQUEST_URI" => '/zzz'))
+    assert_equal "/zzz\n", str.string
+  end
+
   def test_cookies
     str = StringIO.new
     app = lambda { |env|