Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added some docs on ActiveResource::HttpMock

  • Loading branch information...
commit 06b91381889fcbd32018ab045b1795ada8718cad 1 parent 825dae1
@smartinez87 smartinez87 authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 activeresource/lib/active_resource/http_mock.rb
View
4 activeresource/lib/active_resource/http_mock.rb
@@ -299,6 +299,8 @@ def initialize(body, message = 200, headers = {})
end
end
+ # Returns true if code is 2xx,
+ # false otherwise.
def success?
code.in?(200..299)
end
@@ -311,6 +313,8 @@ def []=(key, value)
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
Please sign in to comment.
Something went wrong with that request. Please try again.