Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add test for WEBrick partial hijack

  • Loading branch information...
commit 146614c705b83faabac9a03189a53d3ca5176396 1 parent c5621e9
@dahakawang authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/spec_webrick.rb
View
23 test/spec_webrick.rb
@@ -139,5 +139,28 @@
}
end
+ should "support Rack partial hijack" do
+ io_lambda = lambda{ |io|
+ 5.times do
+ io.write "David\r\n"
+ end
+ io.close
+ }
+
+ @server.mount "/partial", Rack::Handler::WEBrick,
+ Rack::Lint.new(lambda{ |req|
+ [
+ 200,
+ {"rack.hijack" => io_lambda},
+ [""]
+ ]
+ })
+
+ Net::HTTP.start(@host, @port){ |http|
+ res = http.get("/partial")
+ res.body.should.equal "David\r\nDavid\r\nDavid\r\nDavid\r\nDavid\r\n"
+ }
+ end
+
@server.shutdown
end
Please sign in to comment.
Something went wrong with that request. Please try again.