diff options
Diffstat (limited to 'test/spec_deflater.rb')
-rw-r--r-- | test/spec_deflater.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/spec_deflater.rb b/test/spec_deflater.rb index 6cac22ac..23880eaa 100644 --- a/test/spec_deflater.rb +++ b/test/spec_deflater.rb @@ -510,4 +510,13 @@ describe Rack::Deflater do raw_bytes.must_be(:<, content.bytesize) end end + + it 'does not close the response body prematurely' do + app_body = Object.new + class << app_body; attr_reader :closed; def each; yield('foo'); yield('bar'); end; def close; @closed = true; end; end + + verify(200, 'foobar', deflate_or_gzip, { 'app_body' => app_body }) do |status, headers, body| + assert_nil app_body.closed + end + end end |