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 7979
8080 before do
8181 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
8587 end
8688
8789 it "raises an exception" do
@@ -731,8 +733,13 @@ def synchronize_method!(object, method_name)
731733 it "should set host(s)" do
732734 plugin . register
733735 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 [ {
736743 :scheme => "https" ,
737744 :host => "ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io" ,
738745 :port => 9243 ,
You can’t perform that action at this time.
0 commit comments