Permalink
Browse files

Merge branch 'master' of git://github.com/ryana/typhoeus

Conflicts:
	lib/typhoeus/easy.rb
  • Loading branch information...
2 parents ad9ba67 + e5b30a2 commit 7644d3e6c6000ce60a03b2661bcbc24cad365fb8 @dbalatero dbalatero committed Jun 24, 2010
Showing with 10 additions and 2 deletions.
  1. +2 −2 lib/typhoeus/easy.rb
  2. +8 −0 spec/typhoeus/easy_spec.rb
View
@@ -152,7 +152,7 @@ def method=(method)
elsif method == :head
set_option(OPTION_VALUES[:CURLOPT_NOBODY], 1)
else
- set_option(OPTION_VALUES[:CURLOPT_CUSTOMREQUEST], "DELETE")
+ set_option(OPTION_VALUES[:CURLOPT_CUSTOMREQUEST], method.to_s.upcase)
end
end
@@ -210,7 +210,7 @@ def ssl_key=(key)
#
def ssl_key_type=(key_type)
raise "Invalid ssl key type : '#{key_type}'..." if key_type and !%w(PEM DER ENG).include?(key_type)
- set_option(OPTION_VALUES[:CURLOPT_SSLKEYTYPE], key_type)
+ set_option(OPTION_VALUES[:CURLOPT_SSLKEYTYPE], key_type)
end
def ssl_key_password=(key_password)
@@ -117,6 +117,14 @@
end
end
+ describe "purge" do
+ it "should set custom request to purge" do
+ easy = Typhoeus::Easy.new
+ easy.should_receive(:set_option).with(Typhoeus::Easy::OPTION_VALUES[:CURLOPT_CUSTOMREQUEST], "PURGE").once
+ easy.method = :purge
+ end
+ end
+
describe "head" do
it "should perform a head" do
easy = Typhoeus::Easy.new

0 comments on commit 7644d3e

Please sign in to comment.