Permalink
Browse files

More tests for Patron.

  • Loading branch information...
1 parent 74e8caa commit a5e6e9780804c350d1459ce88a6393efef6b9f56 @mdub committed Oct 17, 2010
Showing with 21 additions and 0 deletions.
  1. +21 −0 spec/sham_rack_spec.rb
View
@@ -250,6 +250,17 @@ def env
end
+ it "supports PUT using Patron" do
+
+ patron = Patron::Session.new
+ response = patron.put("http://env.xyz/resource", "stuff", "Content-Type" => "text/plain")
+
+ env["REQUEST_METHOD"].should == "PUT"
+ env["CONTENT_TYPE"].should == "text/plain"
+ env["rack.input"].read.should == "stuff"
+
+ end
+
it "supports DELETE" do
RestClient.delete("http://env.xyz/thing/1")
@@ -259,6 +270,16 @@ def env
end
+ it "supports DELETE using Patron" do
+
+ patron = Patron::Session.new
+ response = patron.delete("http://env.xyz/resource")
+
+ env["REQUEST_METHOD"].should == "DELETE"
+ env["PATH_INFO"].should == "/resource"
+
+ end
+
end
end

0 comments on commit a5e6e97

Please sign in to comment.