diff --git a/lib/tinder/connection.rb b/lib/tinder/connection.rb index d0136f0..d14d247 100644 --- a/lib/tinder/connection.rb +++ b/lib/tinder/connection.rb @@ -1,11 +1,16 @@ # encoding: UTF-8 require 'faraday' +require 'faraday/request/multipart' require 'faraday/response/raise_on_authentication_failure' require 'faraday/response/remove_whitespace' require 'faraday_middleware' require 'json' require 'uri' +class Faraday::RequestOptions + attr_accessor :preserve_raw +end + module Tinder class Connection HOST = 'campfirenow.com' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9f75b26..2bdb26d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,8 @@ require 'tinder' require 'fakeweb' +require 'faraday/adapter/test' + FakeWeb.allow_net_connect = false def fixture(name) diff --git a/spec/tinder/connection_spec.rb b/spec/tinder/connection_spec.rb index 9d6805c..aa015bf 100644 --- a/spec/tinder/connection_spec.rb +++ b/spec/tinder/connection_spec.rb @@ -82,7 +82,7 @@ end connection = Tinder::Connection.new('test', :username => 'user', :password => 'pass', :ssl_verify => false) - connection.connection.ssl[:verify].should be == false + connection.connection.ssl.verify?.should be == false end it "should allow passing any ssl_options to Faraday" do @@ -98,7 +98,7 @@ :ca_file => "/etc/ssl/custom" } ) - connection.connection.ssl.should eql(:verify => false, :ca_path => "/usr/lib/ssl/certs", :ca_file => "/etc/ssl/custom") + connection.connection.ssl.to_hash.should eql(:verify => false, :ca_path => "/usr/lib/ssl/certs", :ca_file => "/etc/ssl/custom") end end end diff --git a/tinder.gemspec b/tinder.gemspec index 6a90821..742e604 100644 --- a/tinder.gemspec +++ b/tinder.gemspec @@ -4,7 +4,7 @@ require 'tinder/version' Gem::Specification.new do |gem| gem.add_dependency 'eventmachine', '~> 1.0' - gem.add_dependency 'faraday', '~> 0.8.9' + gem.add_dependency 'faraday', '~> 0.9.0.rc5' gem.add_dependency 'faraday_middleware', '~> 0.9' gem.add_dependency 'hashie', ['>= 1.0', '< 3'] gem.add_dependency 'json', '~> 1.8.0'