Sha256: c34a13b01afe650b0ec10a0ea54ca5139e6e80508d56f3f06e461a79732e162d
Contents?: true
Size: 865 Bytes
Versions: 16
Compression:
Stored size: 865 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')) describe HTTParty::Logger::ApacheLogger do describe "#format" do it "formats a response in a style that resembles apache's access log" do request_time = Time.new.strftime("%Y-%m-%d %H:%M:%S %z") log_message = "[HTTParty] [#{request_time}] 302 \"GET http://my.domain.com/my_path\" - " request_double = double( :http_method => Net::HTTP::Get, :path => "http://my.domain.com/my_path" ) response_double = double( :code => 302, :[] => nil ) logger_double = double logger_double.should_receive(:info).with(log_message) subject = described_class.new(logger_double, :info) subject.current_time = request_time subject.format(request_double, response_double) end end end
Version data entries
16 entries across 15 versions & 5 rubygems