From bc0e24040b900c1800c95172dc2532c82e8b28f6 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 21 May 2008 21:49:45 +0200 Subject: revised conventions in http_mock.rb docs --- activeresource/lib/active_resource/http_mock.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb index 82e3bc8370..cf102da379 100644 --- a/activeresource/lib/active_resource/http_mock.rb +++ b/activeresource/lib/active_resource/http_mock.rb @@ -3,11 +3,11 @@ require 'active_resource/connection' module ActiveResource class InvalidRequestError < StandardError; end #:nodoc: - # One thing that has always been a pain with remote web services is testing. The HttpMock + # One thing that has always been a pain with remote web services is testing. The HttpMock # class makes it easy to test your Active Resource models by creating a set of mock responses to specific # requests. # - # To test your Active Resource model, you simply call the ActiveResource::HttpMock.respond_to + # To test your Active Resource model, you simply call the ActiveResource::HttpMock.respond_to # method with an attached block. The block declares a set of URIs with expected input, and the output # each request should return. The passed in block has any number of entries in the following generalized # format: @@ -16,7 +16,7 @@ module ActiveResource # # * http_method - The HTTP method to listen for. This can be +get+, +post+, +put+, +delete+ or # +head+. - # * path - A string, starting with a "/", defining the URI that is expected to be + # * path - A string, starting with a "/", defining the URI that is expected to be # called. # * request_headers - Headers that are expected along with the request. This argument uses a # hash format, such as { "Content-Type" => "application/xml" }. This mock will only trigger @@ -28,7 +28,7 @@ module ActiveResource # request_headers listed above. # # In order for a mock to deliver its content, the incoming request must match by the http_method, - # +path+ and request_headers. If no match is found an InvalidRequestError exception + # +path+ and request_headers. If no match is found an InvalidRequestError exception # will be raised letting you know you need to create a new mock for that request. # # ==== Example @@ -89,14 +89,14 @@ module ActiveResource end # Returns a hash of request => response pairs for all all responses this mock has delivered, where +request+ - # is an instance of ActiveResource::Request and the response is, naturally, an instance of - # ActiveResource::Response. + # is an instance of ActiveResource::Request and the response is, naturally, an instance of + # ActiveResource::Response. def responses @@responses ||= {} end # Accepts a block which declares a set of requests and responses for the HttpMock to respond to. See the main - # ActiveResource::HttpMock description for a more detailed explanation. + # ActiveResource::HttpMock description for a more detailed explanation. def respond_to(pairs = {}) #:yields: mock reset! pairs.each do |(path, response)| -- cgit v1.2.3