aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource
diff options
context:
space:
mode:
authorGaston Ramos <ramos.gaston@gmail.com>2010-10-06 19:27:25 -0300
committerJosé Valim <jose.valim@gmail.com>2010-10-07 16:50:47 +0200
commitcec6f3fe209f0c2312da1e1d091bffd30d6733b0 (patch)
tree98145a80a4efc0b16df5292660007f9ed190c5eb /activeresource/lib/active_resource
parentaee043de5a7f1189bd82ce6da20fffbefe36983b (diff)
downloadrails-cec6f3fe209f0c2312da1e1d091bffd30d6733b0.tar.gz
rails-cec6f3fe209f0c2312da1e1d091bffd30d6733b0.tar.bz2
rails-cec6f3fe209f0c2312da1e1d091bffd30d6733b0.zip
- update documentation
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r--activeresource/lib/active_resource/http_mock.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb
index 2250ed9c04..9aefde7c30 100644
--- a/activeresource/lib/active_resource/http_mock.rb
+++ b/activeresource/lib/active_resource/http_mock.rb
@@ -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