Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Passing :string to register_uri is deprecated. Update the README.

  • Loading branch information...
commit e72d0a18bfaca8db925d1b7084df77eb5887b3e2 1 parent 0390b42
@r00k authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 README.rdoc
View
12 README.rdoc
@@ -31,7 +31,7 @@ Start by requiring FakeWeb:
=== Registering basic string responses
- FakeWeb.register_uri(:get, "http://example.com/test1", :string => "Hello World!")
+ FakeWeb.register_uri(:get, "http://example.com/test1", :body => "Hello World!")
Net::HTTP.get(URI.parse("http://example.com/test1"))
=> "Hello World!"
@@ -49,7 +49,7 @@ Start by requiring FakeWeb:
=== Adding a custom status to the response
- FakeWeb.register_uri(:get, "http://example.com/", :string => "Nothing to be found 'round here",
+ FakeWeb.register_uri(:get, "http://example.com/", :body => "Nothing to be found 'round here",
:status => ["404", "Not Found"])
Net::HTTP.start("example.com") do |req|
@@ -61,7 +61,7 @@ Start by requiring FakeWeb:
=== Responding to any HTTP method
- FakeWeb.register_uri(:any, "http://example.com", :string => "response for any HTTP method")
+ FakeWeb.register_uri(:any, "http://example.com", :body => "response for any HTTP method")
If you use the <tt>:any</tt> symbol, the URI you specify will be completely
stubbed out (regardless of the HTTP method of the request). This can be useful
@@ -79,8 +79,8 @@ a response more than once before rotating, by specifying a <tt>:times</tt>
option for that response.)
FakeWeb.register_uri(:delete, "http://example.com/posts/1",
- [{:string => "Post 1 deleted.", :status => ["200", "OK"]},
- {:string => "Post not found", :status => ["404", "Not Found"]}])
+ [{:body => "Post 1 deleted.", :status => ["200", "OK"]},
+ {:body => "Post not found", :status => ["404", "Not Found"]}])
Net::HTTP.start("example.com") do |req|
req.delete("/posts/1").body # => "Post 1 deleted"
@@ -157,4 +157,4 @@ Copyright 2008-2009 various contributors
with FakeWeb; if not, write to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-See LICENSE.txt[link:files/LICENSE_txt.html] for the full terms.
+See LICENSE.txt[link:files/LICENSE_txt.html] for the full terms.
Please sign in to comment.
Something went wrong with that request. Please try again.