Vendor Rack 1.1
Also clean up some View stuff.
This commit is contained in:
parent
77014652a3
commit
a705709f9a
74 changed files with 3080 additions and 608 deletions
21
vendor/plugins/rack/test/spec_rack_logger.rb
vendored
Normal file
21
vendor/plugins/rack/test/spec_rack_logger.rb
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
require 'rack/logger'
|
||||
require 'rack/lint'
|
||||
require 'stringio'
|
||||
|
||||
context "Rack::Logger" do
|
||||
specify "logs to rack.errors" do
|
||||
app = lambda { |env|
|
||||
log = env['rack.logger']
|
||||
log.debug("Created logger")
|
||||
log.info("Program started")
|
||||
log.warn("Nothing to do!")
|
||||
|
||||
[200, {'Content-Type' => 'text/plain'}, ["Hello, World!"]]
|
||||
}
|
||||
|
||||
errors = StringIO.new
|
||||
Rack::Logger.new(app).call({'rack.errors' => errors})
|
||||
errors.string.should.match "INFO -- : Program started"
|
||||
errors.string.should.match "WARN -- : Nothing to do"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue