aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib
diff options
context:
space:
mode:
authorSebastian Martinez <sebastian@wyeworks.com>2011-05-01 15:59:27 -0300
committerSebastian Martinez <sebastian@wyeworks.com>2011-05-01 15:59:27 -0300
commit06b91381889fcbd32018ab045b1795ada8718cad (patch)
tree5eed5a93ce17d574ca1adb27229f1d835bfef927 /activeresource/lib
parent825dae1f0b32bac0e5afde61578534d1a3df8b7b (diff)
downloadrails-06b91381889fcbd32018ab045b1795ada8718cad.tar.gz
rails-06b91381889fcbd32018ab045b1795ada8718cad.tar.bz2
rails-06b91381889fcbd32018ab045b1795ada8718cad.zip
Added some docs on ActiveResource::HttpMock
Diffstat (limited to 'activeresource/lib')
-rw-r--r--activeresource/lib/active_resource/http_mock.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb
index 02b1192d7e..3bfd536b29 100644
--- a/activeresource/lib/active_resource/http_mock.rb
+++ b/activeresource/lib/active_resource/http_mock.rb
@@ -299,6 +299,8 @@ module ActiveResource
end
end
+ # Returns true if code is 2xx,
+ # false otherwise.
def success?
code.in?(200..299)
end
@@ -311,6 +313,8 @@ module ActiveResource
headers[key] = value
end
+ # Returns true if the other is a Response with an equal body, equal message
+ # and equal headers. Otherwise it returns false.
def ==(other)
if (other.is_a?(Response))
other.body == body && other.message == message && other.headers == headers