Vendor Rack 1.0.1
Incorporate patch from Revision 496.
This commit is contained in:
parent
a7202d54cd
commit
76f388f3e2
113 changed files with 5759 additions and 199 deletions
32
vendor/plugins/rack/test/spec_rack_commonlogger.rb
vendored
Normal file
32
vendor/plugins/rack/test/spec_rack_commonlogger.rb
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
require 'test/spec'
|
||||
require 'stringio'
|
||||
|
||||
require 'rack/commonlogger'
|
||||
require 'rack/lobster'
|
||||
require 'rack/mock'
|
||||
|
||||
context "Rack::CommonLogger" do
|
||||
app = lambda { |env|
|
||||
[200,
|
||||
{"Content-Type" => "text/html"},
|
||||
["foo"]]}
|
||||
|
||||
specify "should log to rack.errors by default" do
|
||||
log = StringIO.new
|
||||
res = Rack::MockRequest.new(Rack::CommonLogger.new(app)).get("/")
|
||||
|
||||
res.errors.should.not.be.empty
|
||||
res.errors.should =~ /GET /
|
||||
res.errors.should =~ / 200 / # status
|
||||
res.errors.should =~ / 3 / # length
|
||||
end
|
||||
|
||||
specify "should log to anything with <<" do
|
||||
log = ""
|
||||
res = Rack::MockRequest.new(Rack::CommonLogger.new(app, log)).get("/")
|
||||
|
||||
log.should =~ /GET /
|
||||
log.should =~ / 200 / # status
|
||||
log.should =~ / 3 / # length
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue