Skip to content

Instantly share code, notes, and snippets.

@spastorino
Created March 3, 2012 04:35
Show Gist options
  • Select an option

  • Save spastorino/1964379 to your computer and use it in GitHub Desktop.

Select an option

Save spastorino/1964379 to your computer and use it in GitHub Desktop.
diff --git a/test/context_test.rb b/test/context_test.rb
index 36e7022..aefe2b9 100644
--- a/test/context_test.rb
+++ b/test/context_test.rb
@@ -913,4 +913,19 @@ describe 'Rack::Cache::Context' do
response.body.should.equal 'Hello World'
cache.trace.should.include :pass
end
+
+ it 'logs to rack.logger if available' do
+ logger = Struct.new(:expect).new
+ class << logger
+ def info(message)
+ self.expect = "info"
+ end
+ end
+
+ respond_with 200
+ get '/',
+ 'rack.logger' => logger
+ response.should.be.ok
+ logger.expect.should.equal "info"
+ end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment