1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

HttpMock InvalidRequestError inspects the mismatched request

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2006-12-21 22:18:58 +00:00
parent e6988ef2ce
commit 8cb6cb58a2

View file

@ -46,7 +46,7 @@ module ActiveResource
def #{method}(path, body, headers) def #{method}(path, body, headers)
request = ActiveResource::Request.new(:#{method}, path, body, headers) request = ActiveResource::Request.new(:#{method}, path, body, headers)
self.class.requests << request self.class.requests << request
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request}")) self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request.inspect}"))
end end
EOE EOE
end end
@ -56,7 +56,7 @@ module ActiveResource
def #{method}(path, headers) def #{method}(path, headers)
request = ActiveResource::Request.new(:#{method}, path, nil, headers) request = ActiveResource::Request.new(:#{method}, path, nil, headers)
self.class.requests << request self.class.requests << request
self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request}")) self.class.responses[request] || raise(InvalidRequestError.new("No response recorded for: \#{request.inspect}"))
end end
EOE EOE
end end