Skip to content

Commit

Permalink
Switch back to released faraday.
Browse files Browse the repository at this point in the history
@i0rek moved the new typhoeus faraday adapter into typhoeus itself.
  • Loading branch information
myronmarston committed Oct 30, 2012
1 parent a20ac40 commit 8043c32
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 42 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ gem 'appraisal'

gem 'typhoeus', :git => "https://github.com/typhoeus/typhoeus.git"
gem 'webmock', :git => "https://github.com/i0rek/webmock.git", :branch => "typhoeus_0.5.0"
gem 'faraday', :git => "https://github.com/i0rek/faraday.git", :branch => "typhoeus_0.5.0"

gemspec

Expand Down
11 changes: 6 additions & 5 deletions features/configuration/hook_into.feature
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Feature: hook_into
require 'excon'
require 'faraday'
require 'vcr'
<extra_require>
VCR.configure { |c| c.ignore_localhost = true }
Expand Down Expand Up @@ -167,8 +168,8 @@ Feature: hook_into
| Faraday 2: Hello faraday |

Examples:
| hook_into | faraday_adapter |
| :fakeweb | net_http |
| :webmock | net_http |
| :fakeweb | typhoeus |
| :webmock | typhoeus |
| hook_into | faraday_adapter | extra_require |
| :fakeweb | net_http | |
| :webmock | net_http | |
| :fakeweb | typhoeus | require 'typhoeus/adapters/faraday' |
| :webmock | typhoeus | require 'typhoeus/adapters/faraday' |
7 changes: 4 additions & 3 deletions features/middleware/faraday.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Feature: Faraday middleware
require 'faraday'
require 'vcr'
<extra_require>
VCR.configure do |c|
c.default_cassette_options = { :serialize_with => :syck }
Expand Down Expand Up @@ -49,7 +50,7 @@ Feature: Faraday middleware
And the file "cassettes/example.yml" should contain "Hello foo 1"

Examples:
| adapter |
| net_http |
| typhoeus |
| adapter | extra_require |
| net_http | |
| typhoeus | require 'typhoeus/adapters/faraday' |

3 changes: 2 additions & 1 deletion features/support/vcr_cucumber_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def available?; true; end
end

def include_http_adapter_for(lib)
require 'support/http_library_adapters'
require (lib =~ /faraday/ ? 'faraday' : lib)
require 'typhoeus' if lib.include?('typhoeus') # for faraday-typhoeus
require 'support/http_library_adapters'
include HTTP_LIBRARY_ADAPTERS[lib]
end

Expand Down
1 change: 0 additions & 1 deletion gemfiles/typhoeus-new.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source :rubygems

gem "appraisal"
gem "webmock", :git=>"https://github.com/i0rek/webmock.git", :branch=>"typhoeus_0.5.0"
gem "faraday", :git=>"https://github.com/i0rek/faraday.git", :branch=>"typhoeus_0.5.0"
gem "jruby-openssl", :platforms=>:jruby
gem "yard"
gem "relish", "~> 0.6"
Expand Down
26 changes: 10 additions & 16 deletions gemfiles/typhoeus-new.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: https://github.com/i0rek/faraday.git
revision: 69a2fa65e3a37e1fe9e8a2e4c900d79a3bc0546a
branch: typhoeus_0.5.0
specs:
faraday (0.9.0.pre)
multipart-post (~> 1.1)

GIT
remote: https://github.com/i0rek/webmock.git
revision: aeac5cc6a1ac7a313c138514d66cd536802b9dc4
Expand All @@ -17,10 +9,10 @@ GIT

GIT
remote: https://github.com/typhoeus/typhoeus.git
revision: 73ef1a00c2615cf77e92591c1efd885ffafb16b6
revision: 6f4e9079ade2f90c20341dddd022ab1d153400ec
specs:
typhoeus (0.5.0.rc)
ethon (= 0.5.0)
ethon (= 0.5.1)

PATH
remote: /Users/myron/code/vcr
Expand All @@ -40,8 +32,8 @@ GEM
cucumber (>= 1.1.1)
ffi (>= 1.0.11)
rspec (>= 2.7.0)
builder (3.1.3)
childprocess (0.3.5)
builder (3.1.4)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
columnize (0.3.6)
cookiejar (0.3.0)
Expand Down Expand Up @@ -69,12 +61,14 @@ GEM
http_parser.rb (>= 0.5.3)
em-socksify (0.2.1)
eventmachine (>= 1.0.0.beta.4)
ethon (0.5.0)
ethon (0.5.1)
ffi (~> 1.0.11)
mime-types (~> 1.18)
eventmachine (1.0.0)
excon (0.16.4)
excon (0.16.7)
fakeweb (1.3.0)
faraday (0.8.4)
multipart-post (~> 1.1)
ffi (1.0.11)
fuubar (1.0.0)
rspec (~> 2.0)
Expand Down Expand Up @@ -136,7 +130,7 @@ GEM
tilt (1.3.3)
timecop (0.3.5)
yajl-ruby (1.1.0)
yard (0.8.2.1)
yard (0.8.3)

PLATFORMS
ruby
Expand All @@ -151,7 +145,7 @@ DEPENDENCIES
em-http-request (~> 1.0.2)
excon (>= 0.11.0, < 1.0)
fakeweb (~> 1.3.0)
faraday!
faraday (~> 0.8)
fuubar
fuubar-cucumber
github-markup
Expand Down
1 change: 0 additions & 1 deletion gemfiles/typhoeus-old.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source :rubygems

gem "appraisal"
gem "faraday", :git=>"https://github.com/i0rek/faraday.git", :branch=>"typhoeus_0.5.0"
gem "jruby-openssl", :platforms=>:jruby
gem "yard"
gem "relish", "~> 0.6"
Expand Down
20 changes: 7 additions & 13 deletions gemfiles/typhoeus-old.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: https://github.com/i0rek/faraday.git
revision: 69a2fa65e3a37e1fe9e8a2e4c900d79a3bc0546a
branch: typhoeus_0.5.0
specs:
faraday (0.9.0.pre)
multipart-post (~> 1.1)

PATH
remote: /Users/myron/code/vcr
specs:
Expand All @@ -24,8 +16,8 @@ GEM
cucumber (>= 1.1.1)
ffi (>= 1.0.11)
rspec (>= 2.7.0)
builder (3.1.3)
childprocess (0.3.5)
builder (3.1.4)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
columnize (0.3.6)
cookiejar (0.3.0)
Expand Down Expand Up @@ -54,8 +46,10 @@ GEM
em-socksify (0.2.1)
eventmachine (>= 1.0.0.beta.4)
eventmachine (1.0.0)
excon (0.16.4)
excon (0.16.7)
fakeweb (1.3.0)
faraday (0.8.4)
multipart-post (~> 1.1)
ffi (1.1.5)
fuubar (1.0.0)
rspec (~> 2.0)
Expand Down Expand Up @@ -123,7 +117,7 @@ GEM
addressable (>= 2.2.7)
crack (>= 0.1.7)
yajl-ruby (1.1.0)
yard (0.8.2.1)
yard (0.8.3)

PLATFORMS
ruby
Expand All @@ -138,7 +132,7 @@ DEPENDENCIES
em-http-request (~> 1.0.2)
excon (>= 0.11.0, < 1.0)
fakeweb (~> 1.3.0)
faraday!
faraday (~> 0.8)
fuubar
fuubar-cucumber
github-markup
Expand Down
6 changes: 6 additions & 0 deletions spec/support/http_library_adapters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ def normalize_request_headers(headers)
end

%w[ net_http typhoeus patron ].each do |_faraday_adapter|
if _faraday_adapter == 'typhoeus' &&
defined?(::Typhoeus::VERSION) &&
::Typhoeus::VERSION.to_f >= 0.5
require 'typhoeus/adapters/faraday'
end

HTTP_LIBRARY_ADAPTERS["faraday (w/ #{_faraday_adapter})"] = Module.new do
class << self; self; end.class_eval do
define_method(:http_library_name) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.test_record_and_playback(description, query)
test_record_and_playback "with a complex escaped query param", "q=#{CGI.escape("A&(! 234k !@ kasdj232\#$ kjw35")}"

it 'plays back an empty body response exactly as it was recorded (e.g. nil vs empty string)' do
pending "awaiting an external fix", :if => library_hook_name == :fakeweb do
pending "awaiting an external fix", :if => library.gsub('_', '/').include?('net/http') && library_hook_name != :webmock do
get_body = lambda do
VCR.use_cassette('empty_body', :record => :once) do
get_body_object make_http_request(:get, "http://localhost:#{VCR::SinatraApp.port}/204")
Expand Down

0 comments on commit 8043c32

Please sign in to comment.