diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-01-06 17:23:13 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-01-06 17:23:13 -0800 |
commit | ab37f2d65b01370ae975346110471f33b10bd178 (patch) | |
tree | 5fb44351728130e02b6c2f5cc89218d6fb619aa2 /test | |
parent | b082327b0363f5236a267abd8a412e18ce9918e0 (diff) | |
download | clogger-ab37f2d65b01370ae975346110471f33b10bd178.tar.gz |
It's too crazy to have to special case for frozen response constants. 3-element arrays are cheap under Ruby 1.9 anyways.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_clogger.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb index 215256c..1906718 100644 --- a/test/test_clogger.rb +++ b/test/test_clogger.rb @@ -517,6 +517,22 @@ class TestClogger < Test::Unit::TestCase assert_nil body.close end + def test_clogger_response_frozen + response = [ 200, { "AAAA" => "AAAA"}.freeze, [].freeze ].freeze + s = StringIO.new("") + app = Rack::Builder.new do + use Clogger, :logger => s, :format => "$request_time $http_host" + run lambda { |env| response } + end + assert_nothing_raised do + 3.times do + resp = app.call(@req) + assert ! resp.frozen? + resp.last.each { |x| } + end + end + end + def test_clogger_body_close_return_value s = '' body = [] |