test/integration/transport_test.rb in elasticsearch-transport-7.12.0 vs test/integration/transport_test.rb in elasticsearch-transport-7.13.0.pre

- old
+ new

@@ -30,18 +30,31 @@ setup do @host, @port = ELASTICSEARCH_HOSTS.first.split(':') begin; Object.send(:remove_const, :Patron); rescue NameError; end end - should "allow to customize the Faraday adapter" do + should "allow to customize the Faraday adapter to Typhoeus" do require 'typhoeus' require 'typhoeus/adapters/faraday' transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \ :hosts => [ { host: @host, port: @port } ] do |f| f.response :logger f.adapter :typhoeus end + + client = Elasticsearch::Transport::Client.new transport: transport + client.perform_request 'GET', '' + end unless jruby? + + should "allow to customize the Faraday adapter to NetHttpPersistent" do + require 'net/http/persistent' + + transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \ + :hosts => [ { host: @host, port: @port } ] do |f| + f.response :logger + f.adapter :net_http_persistent + end client = Elasticsearch::Transport::Client.new transport: transport client.perform_request 'GET', '' end