Permalink
Browse files

don't test the logger like its a real adapter

  • Loading branch information...
1 parent 7d12ed5 commit d2ce9aad2002ccbe2088c30424336655e1de3fe0 @technoweenie technoweenie committed Feb 27, 2011
Showing with 5 additions and 2 deletions.
  1. +3 −1 lib/faraday/adapter/logger.rb
  2. +2 −1 lib/faraday/response.rb
@@ -1,11 +1,13 @@
module Faraday
class Adapter
class Logger < Faraday::Adapter
+ def self.loaded?() false end
+
def initialize(app = nil, logger = nil)
super(app)
@logger = logger || begin
require 'logger'
- Logger.new(STDOUT)
+ ::Logger.new(STDOUT)
end
end
View
@@ -42,7 +42,8 @@ def on_complete(&block)
def finish(env)
return self if @status
- env[:body] ||= ''
+ env[:body] ||= ''
+ env[:response_headers] ||= {}
@on_complete_callbacks.each { |c| c.call(env) }
@status, @headers, @body = env[:status], env[:response_headers], env[:body]
self

0 comments on commit d2ce9aa

Please sign in to comment.