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 92
92
93
93
before do
94
94
allow ( Elasticsearch ::Client ) . to receive ( :new ) . and_return ( es_client )
95
- allow ( es_client ) . to receive ( :info ) . and_raise (
96
- Elasticsearch ::Transport ::Transport ::Errors ::BadRequest . new
97
- )
95
+ begin
96
+ allow ( es_client ) . to receive ( :info ) . and_raise ( Elasticsearch ::Transport ::Transport ::Errors ::BadRequest . new )
97
+ rescue NameError # NameError: uninitialized constant Elasticsearch::Transport
98
+ allow ( es_client ) . to receive ( :info ) . and_raise ( Elastic ::Transport ::Transport ::Errors ::BadRequest . new )
99
+ end
98
100
end
99
101
100
102
it "raises an exception" do
@@ -744,8 +746,13 @@ def synchronize_method!(object, method_name)
744
746
it "should set host(s)" do
745
747
plugin . register
746
748
client = plugin . send ( :client )
747
-
748
- expect ( client . transport . instance_variable_get ( :@seeds ) ) . to eql [ {
749
+ target_field = :@seeds
750
+ begin
751
+ Elasticsearch ::Transport ::Client
752
+ rescue
753
+ target_field = :@hosts
754
+ end
755
+ expect ( client . transport . instance_variable_get ( target_field ) ) . to eql [ {
749
756
:scheme => "https" ,
750
757
:host => "ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io" ,
751
758
:port => 9243 ,
You can’t perform that action at this time.
0 commit comments