PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/bundle/jruby/2.1/gems/rack-1.5.2/test/spec_nulllogger.rb

https://github.com/delowong/logstash
Ruby | 20 lines | 17 code | 3 blank | 0 comment | 0 complexity | 57c8a1c72f9c5a8113efa0b5c9509379 MD5 | raw file
 1require 'rack/lint'
 2require 'rack/mock'
 3require 'rack/nulllogger'
 4
 5describe Rack::NullLogger do
 6  should "act as a noop logger" do
 7    app = lambda { |env|
 8      env['rack.logger'].warn "b00m"
 9      [200, {'Content-Type' => 'text/plain'}, ["Hello, World!"]]
10    }
11
12    logger = Rack::Lint.new(Rack::NullLogger.new(app))
13
14    res = logger.call(Rack::MockRequest.env_for)
15    res[0..1].should.equal [
16      200, {'Content-Type' => 'text/plain'}
17    ]
18    res[2].to_enum.to_a.should.equal ["Hello, World!"]
19  end
20end