Skip to content
This repository
Browse code

merge

  • Loading branch information...
commit b0ebabafa4ee90a943adb4707a2cee4199e7f5c8 2 parents 8cad284 + 98dc582
Pratik authored May 25, 2008
12  activeresource/lib/active_resource/http_mock.rb
@@ -2,7 +2,7 @@
2 2
 
3 3
 module ActiveResource
4 4
   class InvalidRequestError < StandardError; end #:nodoc:
5  
-  
  5
+
6 6
   # One thing that has always been a pain with remote web services is testing.  The HttpMock
7 7
   # class makes it easy to test your Active Resource models by creating a set of mock responses to specific
8 8
   # requests.
@@ -63,7 +63,7 @@ def #{method}(path, request_headers = {}, body = nil, status = 200, response_hea
63 63
     end
64 64
 
65 65
     class << self
66  
-      
  66
+
67 67
       # Returns an array of all request objects that have been sent to the mock.  You can use this to check
68 68
       # wether or not your model actually sent an HTTP request.
69 69
       #
@@ -87,14 +87,14 @@ class << self
87 87
       def requests
88 88
         @@requests ||= []
89 89
       end
90  
-      
  90
+
91 91
       # Returns a hash of <tt>request => response</tt> pairs for all all responses this mock has delivered, where +request+
92 92
       # is an instance of ActiveResource::Request and the response is, naturally, an instance of
93 93
       # ActiveResource::Response.
94 94
       def responses
95 95
         @@responses ||= {}
96 96
       end
97  
-      
  97
+
98 98
       # Accepts a block which declares a set of requests and responses for the HttpMock to respond to. See the main
99 99
       # ActiveResource::HttpMock description for a more detailed explanation.
100 100
       def respond_to(pairs = {}) #:yields: mock
@@ -109,7 +109,7 @@ def respond_to(pairs = {}) #:yields: mock
109 109
           Responder.new(responses)
110 110
         end
111 111
       end
112  
-      
  112
+
113 113
       # Deletes all logged requests and responses.
114 114
       def reset!
115 115
         requests.clear
@@ -136,7 +136,7 @@ def #{method}(path, headers)
136 136
         end
137 137
       EOE
138 138
     end
139  
-    
  139
+
140 140
     def initialize(site) #:nodoc:
141 141
       @site = site
142 142
     end

0 notes on commit b0ebaba

Please sign in to comment.
Something went wrong with that request. Please try again.