File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 79
79
80
80
before do
81
81
allow ( Elasticsearch ::Client ) . to receive ( :new ) . and_return ( es_client )
82
- allow ( es_client ) . to receive ( :info ) . and_raise (
83
- Elasticsearch ::Transport ::Transport ::Errors ::BadRequest . new
84
- )
82
+ begin
83
+ allow ( es_client ) . to receive ( :info ) . and_raise ( Elasticsearch ::Transport ::Transport ::Errors ::BadRequest . new )
84
+ rescue NameError # NameError: uninitialized constant Elasticsearch::Transport
85
+ allow ( es_client ) . to receive ( :info ) . and_raise ( Elastic ::Transport ::Transport ::Errors ::BadRequest . new )
86
+ end
85
87
end
86
88
87
89
it "raises an exception" do
@@ -731,8 +733,13 @@ def synchronize_method!(object, method_name)
731
733
it "should set host(s)" do
732
734
plugin . register
733
735
client = plugin . send ( :client )
734
-
735
- expect ( client . transport . instance_variable_get ( :@seeds ) ) . to eql [ {
736
+ target_field = :@seeds
737
+ begin
738
+ Elasticsearch ::Transport ::Client
739
+ rescue
740
+ target_field = :@hosts
741
+ end
742
+ expect ( client . transport . instance_variable_get ( target_field ) ) . to eql [ {
736
743
:scheme => "https" ,
737
744
:host => "ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io" ,
738
745
:port => 9243 ,
You can’t perform that action at this time.
0 commit comments