Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- update documentation

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit cec6f3fe209f0c2312da1e1d091bffd30d6733b0 1 parent aee043d
@gramos gramos authored josevalim committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 activeresource/lib/active_resource/http_mock.rb
View
9 activeresource/lib/active_resource/http_mock.rb
@@ -168,6 +168,15 @@ def responses
#
# ActiveResource::HttpMock.respond_to(pairs, false)
# ActiveResource::HttpMock.responses.length #=> 2
+ #
+ # # If you add a response with an existing request, it will be replaced
+ #
+ # fail_response = ActiveResource::Response.new("", 404, {})
+ # pairs = {get_matz => fail_response}
+ #
+ # ActiveResource::HttpMock.respond_to(pairs, false)
+ # ActiveResource::HttpMock.responses.length #=> 2
+ #
def respond_to(*args) #:yields: mock
pairs = args.first || {}
reset! if args.last.class != FalseClass
Please sign in to comment.
Something went wrong with that request. Please try again.