File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
spec/elasticsearch/transport Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 266
266
it 'uses Faraday with the adapter' do
267
267
expect ( adapter ) . to eq Faraday ::Adapter ::Typhoeus
268
268
end
269
- end
269
+ end unless jruby?
270
270
271
271
context 'when the adapter is specified as a string key' do
272
272
let ( :adapter ) do
1776
1776
it 'preserves the other headers' do
1777
1777
expect ( client . transport . connections [ 0 ] . connection . headers [ 'User-Agent' ] )
1778
1778
end
1779
- end
1779
+ end unless jruby?
1780
1780
end
1781
1781
end
1782
1782
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class Elasticsearch::Transport::ClientIntegrationTest < Elasticsearch::Test::Int
32
32
begin ; Object . send ( :remove_const , :Patron ) ; rescue NameError ; end
33
33
end
34
34
35
- should "allow to customize the Faraday adapter" do
35
+ should "allow to customize the Faraday adapter to Typhoeus " do
36
36
require 'typhoeus'
37
37
require 'typhoeus/adapters/faraday'
38
38
@@ -42,6 +42,19 @@ class Elasticsearch::Transport::ClientIntegrationTest < Elasticsearch::Test::Int
42
42
f . adapter :typhoeus
43
43
end
44
44
45
+ client = Elasticsearch ::Transport ::Client . new transport : transport
46
+ client . perform_request 'GET' , ''
47
+ end unless jruby?
48
+
49
+ should "allow to customize the Faraday adapter to NetHttpPersistent" do
50
+ require 'net/http/persistent'
51
+
52
+ transport = Elasticsearch ::Transport ::Transport ::HTTP ::Faraday . new \
53
+ :hosts => [ { host : @host , port : @port } ] do |f |
54
+ f . response :logger
55
+ f . adapter :net_http_persistent
56
+ end
57
+
45
58
client = Elasticsearch ::Transport ::Client . new transport : transport
46
59
client . perform_request 'GET' , ''
47
60
end
You can’t perform that action at this time.
0 commit comments