From 06b91381889fcbd32018ab045b1795ada8718cad Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Sun, 1 May 2011 15:59:27 -0300 Subject: Added some docs on ActiveResource::HttpMock --- activeresource/lib/active_resource/http_mock.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activeresource/lib/active_resource/http_mock.rb') 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 -- cgit v1.2.3