We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d7d24d commit d5938faCopy full SHA for d5938fa
spec/spec_helper.rb
@@ -2,6 +2,16 @@
2
require "rspec/mocks"
3
require "logstash/devutils/rspec/spec_helper"
4
5
+# Since we use Logstash's x-pack WITHOUT the LogStash::Runner,
6
+# we must find it relative to logstash-core and add it to the load path.
7
+require 'pathname'
8
+logstash_core_path = Gem.loaded_specs['logstash-core']&.full_gem_path or fail("logstash-core lib not found")
9
+logstash_xpack_load_path = Pathname.new(logstash_core_path).join("../x-pack/lib").cleanpath.to_s
10
+unless $LOAD_PATH.include?(logstash_xpack_load_path)
11
+ $stderr.puts("ADDING LOGSTASH X-PACK to load path: #{logstash_xpack_load_path}")
12
+ $LOAD_PATH.unshift(logstash_xpack_load_path)
13
+end
14
+
15
module SpecHelper
16
17
def get_host_port_for_es_client
0 commit comments