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

- update documentation

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Gaston Ramos 2010-10-06 19:27:25 -03:00 committed by José Valim
parent aee043de5a
commit cec6f3fe20

View file

@ -168,6 +168,15 @@ module ActiveResource
#
# 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