Browse files

Upgraded dev dependencies to lastest Patron 0.4.17 and updated patron…

… adapter spec to match changes in behaviour.
  • Loading branch information...
1 parent a3e4104 commit a56577e17d304461d9f57e4424c4acfd9d6a9c5d @bblimke committed Jan 22, 2012
Showing with 13 additions and 4 deletions.
  1. +12 −3 spec/acceptance/patron/patron_spec.rb
  2. +1 −1 webmock.gemspec
View
15 spec/acceptance/patron/patron_spec.rb
@@ -96,7 +96,14 @@
Encoding.default_internal = @encoding
end
- it "should encode body based on charset in headers" do
+ it "should encode body with default encoding" do
+ stub_request(:get, "www.example.com").
+ to_return(:body => "Øl")
+
+ @sess.get("").body.encoding.should == Encoding::UTF_8
+ end
+
+ it "should encode body to default internal" do
stub_request(:get, "www.example.com").
to_return(:headers => {'Content-Type' => 'text/html; charset=iso-8859-1'},
:body => "Øl".encode("iso-8859-1"))
@@ -109,17 +116,19 @@
to_return(:body => "<?xml encoding=\"iso-8859-1\">Øl</xml>".encode("iso-8859-1"))
- @sess.get("").body.encoding.should == Encoding.default_internal
+ @sess.get("").body.encoding.should == Encoding::ISO_8859_1
end
+
it "should encode body based on Session#default_response_charset" do
stub_request(:get, "www.example.com").
to_return(:body => "Øl".encode("iso-8859-1"))
@sess.default_response_charset = "iso-8859-1"
- @sess.get("").body.encoding.should == Encoding.default_internal
+ @sess.get("").body.encoding.should == Encoding::ISO_8859_1
end
+
end
end
end
View
2 webmock.gemspec
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', '>= 2.0.0'
s.add_development_dependency 'httpclient', '>= 2.1.5.2'
- s.add_development_dependency 'patron', '>= 0.4.15'
+ s.add_development_dependency 'patron', '>= 0.4.17'
s.add_development_dependency 'em-http-request', '~> 0.3.0'
s.add_development_dependency 'curb', '0.7.15'
s.add_development_dependency 'typhoeus', '>= 0.2.4'

0 comments on commit a56577e

Please sign in to comment.