spec/plugin/chunked_spec.rb in roda-2.20.0 vs spec/plugin/chunked_spec.rb in roda-2.21.0

- old
+ new

@@ -29,10 +29,11 @@ body.must_equal "h#{m}t" end it "accepts a block that is called after layout yielding but before content when streaming" do app(:chunked) do |r| + @h = nil chunked(:inline=>'m<%= @h %>', :layout=>{:inline=>'<%= @h %><%= yield %>t'}) do @h = 'h' end end @@ -111,11 +112,11 @@ app(:chunked) do |r| response.write('a') response.write chunked(:inline=>'m', :layout=>{:inline=>'h<%= yield %>t'}) end - header('Content-Length', 'HTTP_VERSION'=>'HTTP/1.1').must_equal nil + header('Content-Length', 'HTTP_VERSION'=>'HTTP/1.1').must_be_nil header('Content-Length', 'HTTP_VERSION'=>'HTTP/1.0').must_equal '4' end it "stream template responses for view if :chunk_by_default is used" do app(:bare) do @@ -133,11 +134,11 @@ app(:chunked) do |r| chunked(:inline=>'m', :layout=>{:inline=>'h<%= yield %>t'}) end header('Transfer-Encoding', 'HTTP_VERSION'=>'HTTP/1.1').must_equal 'chunked' - header('Transfer-Encoding', 'HTTP_VERSION'=>'HTTP/1.0').must_equal nil + header('Transfer-Encoding', 'HTTP_VERSION'=>'HTTP/1.0').must_be_nil end it "uses given :headers when chunking" do app(:bare) do plugin :chunked, :headers=>{'Foo'=>'bar'} @@ -145,10 +146,10 @@ chunked(:inline=>'m', :layout=>{:inline=>'h<%= yield %>t'}) end end header('Foo', 'HTTP_VERSION'=>'HTTP/1.1').must_equal 'bar' - header('Foo', 'HTTP_VERSION'=>'HTTP/1.0').must_equal nil + header('Foo', 'HTTP_VERSION'=>'HTTP/1.0').must_be_nil end it "handles multiple arguments to chunked" do app(:bare) do plugin :chunked, :chunk_by_default=>true