test/spec_cascade.rb in rack-1.4.1 vs test/spec_cascade.rb in rack-1.4.2

- old
+ new

@@ -48,6 +48,14 @@ Rack::MockRequest.new(cascade).get('/cgi/../..').should.be.client_error Rack::MockRequest.new(cascade).get('/foo').should.be.not_found cascade << app3 Rack::MockRequest.new(cascade).get('/foo').should.be.ok end + + should "close the body on cascade" do + body = StringIO.new + closer = lambda { |env| [404, {}, body] } + cascade = Rack::Cascade.new([closer, app3], [404]) + Rack::MockRequest.new(cascade).get("/foo").should.be.ok + body.should.be.closed + end end