Permalink
Browse files

live test lets you know which adapters arent being run

  • Loading branch information...
technoweenie committed Apr 14, 2012
1 parent a3f5c06 commit 79c5ae3ff9e1103e8c13fab6eef4e7d028c28d44
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/adapters/live_test.rb
@@ -8,7 +8,13 @@ class LiveTest < Faraday::TestCase
adapters = if ENV['ADAPTER']
ENV['ADAPTER'].split(':').map { |name| Faraday::Adapter.lookup_middleware name.to_sym }
else
- loaded_adapters = Faraday::Adapter.all_loaded_constants
+ constants = Faraday::Adapter.constants.map { |c| Faraday::Adapter.const_get(c) }
+ adapters = constants.select { |c| c.respond_to?(:loaded?) }
+ loaded_adapters = adapters.select { |a| a.loaded? }
+ (adapters - loaded_adapters).each do |adapter|
+ puts "Skipping #{adapter} => #{adapter.load_error}"
+ end
+
loaded_adapters -= [Faraday::Adapter::Test, Faraday::Adapter::ActionDispatch]
# https://github.com/geemus/excon/issues/98
loaded_adapters -= [Faraday::Adapter::Excon] if defined? RUBY_ENGINE and "rbx" == RUBY_ENGINE

0 comments on commit 79c5ae3

Please sign in to comment.