From 4a1f74ce08abb40e671ff8c47d5e22df46d15c55 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 14 May 2024 10:13:11 +0100 Subject: [PATCH] [Tests] Reorders checking for valid server --- elasticsearch/spec/integration/characters_escaping_spec.rb | 4 ++-- elasticsearch/spec/integration/client_integration_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/elasticsearch/spec/integration/characters_escaping_spec.rb b/elasticsearch/spec/integration/characters_escaping_spec.rb index 7241bf1f24..f109b1ba23 100644 --- a/elasticsearch/spec/integration/characters_escaping_spec.rb +++ b/elasticsearch/spec/integration/characters_escaping_spec.rb @@ -14,11 +14,11 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +require 'spec_helper' + ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}" raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/ -require 'spec_helper' - context 'Elasticsearch client' do let(:client) do Elasticsearch::Client.new(host: ELASTICSEARCH_URL, user: 'elastic', password: 'changeme') diff --git a/elasticsearch/spec/integration/client_integration_spec.rb b/elasticsearch/spec/integration/client_integration_spec.rb index 2ae47d70e9..a07d3e74d4 100644 --- a/elasticsearch/spec/integration/client_integration_spec.rb +++ b/elasticsearch/spec/integration/client_integration_spec.rb @@ -14,12 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}" -raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/ - require 'spec_helper' require 'logger' +ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}" +raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/ + context 'Elasticsearch client' do let(:logger) { Logger.new($stderr) }