From 34bda71752bc7401c552a7a4d5b77cf7e1bfe431 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Sep 2009 18:15:27 -0700 Subject: expose $request_method as documented in the README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accessing "REQUEST_METHOD" in the Rack env should be doable as a CGI-ish variable. Thanks to IƱaki Baz Castillo for spotting the issue and reporting it to me. --- test/test_clogger.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/test_clogger.rb b/test/test_clogger.rb index 9fd6d05..5b81125 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -402,4 +402,12 @@ class TestClogger < Test::Unit::TestCase assert_equal "GET /hello?goodbye=true\n", str.string end + def test_request_method_only + str = StringIO.new + app = lambda { |env| [302, [ %w(a) ], []] } + cl = Clogger.new(app, :logger => str, :format => '$request_method') + cl.call(@req) + assert_equal "GET\n", str.string + end + end -- cgit v1.2.3-24-ge0c7