mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-07 00:11:11 -04:00
fix live tests
This commit is contained in:
parent
cc64429c76
commit
bc2cd52f70
@ -42,7 +42,8 @@ module Faraday
|
||||
end
|
||||
|
||||
def all_loaded_constants
|
||||
constants.map { |c| const_get(c) }.select { |a| a.loaded? }
|
||||
constants.map { |c| const_get(c) }.
|
||||
select { |a| a.respond_to?(:loaded?) && a.loaded? }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -20,7 +20,6 @@ module Faraday
|
||||
def call(env)
|
||||
super
|
||||
full_path = full_path_for(env[:url].path, env[:url].query, env[:url].fragment)
|
||||
body = env[:body].respond_to?(:read) ? env[:body]
|
||||
@session.__send__(env[:method], full_path, env[:body], env[:request_headers])
|
||||
resp = @session.response
|
||||
env.update \
|
||||
|
@ -3,7 +3,10 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helper'))
|
||||
if Faraday::TestCase::LIVE_SERVER
|
||||
module Adapters
|
||||
class LiveTest < Faraday::TestCase
|
||||
(Faraday::Adapter.all_loaded_constants + [:default]).each do |adapter|
|
||||
loaded_adapters = Faraday::Adapter.all_loaded_constants
|
||||
loaded_adapters -= [Faraday::Adapter::ActionDispatch]
|
||||
loaded_adapters << :default
|
||||
loaded_adapters.each do |adapter|
|
||||
define_method "test_#{adapter}_GET_retrieves_the_response_body" do
|
||||
assert_equal 'hello world', create_connection(adapter).get('hello_world').body
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user