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 9292
9393 before do
9494 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
98100 end
99101
100102 it "raises an exception" do
@@ -744,8 +746,13 @@ def synchronize_method!(object, method_name)
744746 it "should set host(s)" do
745747 plugin . register
746748 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 [ {
749756 :scheme => "https" ,
750757 :host => "ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io" ,
751758 :port => 9243 ,
You can’t perform that action at this time.
0 commit comments