# File lib/active_resource/http_mock.rb, line 258 def initialize(method, path, body = nil, headers = {}) @method, @path, @body, @headers = method, path, body, headers end
# File lib/active_resource/http_mock.rb, line 262 def ==(req) path == req.path && method == req.method && headers_match?(req) end
# File lib/active_resource/http_mock.rb, line 266 def to_s "<#{method.to_s.upcase}: #{path} [#{headers}] (#{body})>" end
# File lib/active_resource/http_mock.rb, line 272 def headers_match?(req) # Ignore format header on equality if it's not defined format_header = ActiveResource::Connection::HTTP_FORMAT_HEADER_NAMES[method] if headers[format_header].present? || req.headers[format_header].blank? headers == req.headers else headers.dup.merge(format_header => req.headers[format_header]) == req.headers end end