spec/spec_helper.rb in elasticsearch-transport-6.8.3 vs spec/spec_helper.rb in elasticsearch-transport-7.0.0.pre
- old
+ new
@@ -1,30 +1,21 @@
-# Licensed to Elasticsearch B.V under one or more agreements.
-# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
-# See the LICENSE file in the project root for more information
-
require 'elasticsearch'
require 'elasticsearch-transport'
require 'logger'
require 'ansi/code'
require 'hashie/mash'
require 'pry-nav'
-if defined?(JRUBY_VERSION)
- require 'elasticsearch/transport/transport/http/manticore'
- require 'pry-nav'
-else
- require 'elasticsearch/transport/transport/http/curb'
- require 'curb'
-end
# The hosts to use for creating a elasticsearch client.
#
# @since 7.0.0
ELASTICSEARCH_HOSTS = if hosts = ENV['TEST_ES_SERVER'] || ENV['ELASTICSEARCH_HOSTS']
hosts.split(',').map do |host|
/(http\:\/\/)?(\S+)/.match(host)[2]
end
end.freeze
+
+TEST_HOST, TEST_PORT = ELASTICSEARCH_HOSTS.first.split(':') if ELASTICSEARCH_HOSTS
# Are we testing on JRuby?
#
# @return [ true, false ] Whether JRuby is being used.
#