diff options
author | Felix Bùˆnemann <buenemann@louis.info> | 2019-09-09 19:55:58 +0200 |
---|---|---|
committer | Felix Bùˆnemann <buenemann@louis.info> | 2019-09-10 14:50:12 +0200 |
commit | 9fbff6e305ad398ed43e70d7c80f4fdd5e7774e4 (patch) | |
tree | a19eb996e07ad5f43687a34e443435ae8c6ce5e3 | |
parent | f7d0fdebf57024e6d8c674380ce7777927b3b1fe (diff) | |
download | rack-9fbff6e305ad398ed43e70d7c80f4fdd5e7774e4.tar.gz |
Add failing test for empty parts in Rack::Deflater
-rw-r--r-- | test/spec_deflater.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/spec_deflater.rb b/test/spec_deflater.rb index a00b5ec3..18fe831b 100644 --- a/test/spec_deflater.rb +++ b/test/spec_deflater.rb @@ -114,6 +114,19 @@ describe Rack::Deflater do end end + it 'be able to deflate bodies that respond to each and contain empty chunks' do + app_body = Object.new + class << app_body; def each; yield('foo'); yield(''); yield('bar'); end; end + + verify(200, 'foobar', deflate_or_gzip, { 'app_body' => app_body }) do |status, headers, body| + headers.must_equal({ + 'Content-Encoding' => 'gzip', + 'Vary' => 'Accept-Encoding', + 'Content-Type' => 'text/plain' + }) + end + end + it 'flush deflated chunks to the client as they become ready' do app_body = Object.new class << app_body; def each; yield('foo'); yield('bar'); end; end |