File tree Expand file tree Collapse file tree 5 files changed +10
-3
lines changed
elasticsearch-transport/lib/elasticsearch/transport Expand file tree Collapse file tree 5 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module Transport
26
26
#
27
27
class Client
28
28
include MetaHeader
29
- DEFAULT_TRANSPORT_CLASS = Transport ::HTTP ::Faraday
29
+ DEFAULT_TRANSPORT_CLASS = Transport ::HTTP ::Faraday
30
30
31
31
DEFAULT_LOGGER = lambda do
32
32
require 'logger'
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ module Elasticsearch
19
19
module Transport
20
20
module Transport
21
21
module HTTP
22
-
23
22
# The default transport implementation, using the [_Faraday_](https://rubygems.org/gems/faraday)
24
23
# library for abstracting the HTTP client.
25
24
#
Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ module Elasticsearch
26
26
27
27
class Client
28
28
include Elasticsearch ::API
29
+ attr_accessor :transport
29
30
31
+ # See Elasticsearch::Transport::Client for initializer parameters
30
32
def initialize ( arguments = { } , &block )
31
33
@verified = false
32
34
@transport = Elasticsearch ::Transport ::Client . new ( arguments , &block )
Original file line number Diff line number Diff line change 50
50
51
51
context 'Reports the right meta header' do
52
52
it 'Reports es service name and gem version' do
53
- headers = client . transport . connections . first . connection . headers
53
+ headers = client . transport . transport . connections . first . connection . headers
54
54
expect ( headers [ 'x-elastic-client-meta' ] ) . to match /^es=#{ Elasticsearch ::VERSION } /
55
55
end
56
56
end
Original file line number Diff line number Diff line change 30
30
expect ( client ) . to respond_to ( :cluster )
31
31
expect ( client ) . to respond_to ( :indices )
32
32
end
33
+
34
+ it 'can access the client transport' do
35
+ client = Elasticsearch ::Client . new
36
+ expect ( client . transport ) . to be_a ( Elasticsearch ::Transport ::Client )
37
+ expect ( client . transport . transport ) . to be_a ( Elasticsearch ::Transport ::Transport ::HTTP ::Faraday )
38
+ end
33
39
end
You can’t perform that action at this time.
0 commit comments