Skip to content

Commit

Permalink
fix LOGSTASH_HOME path, add tmp pattern_path method
Browse files Browse the repository at this point in the history
  • Loading branch information
colinsurprenant committed Mar 24, 2016
1 parent 37381c7 commit 27c6ecc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
# LOGSTASH_HOME will not be defined, so let's set it here
# before requiring the grok filter
unless LogStash::Environment.const_defined?(:LOGSTASH_HOME)
LogStash::Environment::LOGSTASH_HOME = File.expand_path("../", __FILE__)
LogStash::Environment::LOGSTASH_HOME = File.expand_path("../../", __FILE__)
end

# temporary fix to have the spec pass for an urgen mass-publish requirement.
# cut & pasted from the same tmp fix in the grok spec
# see https://github.com/logstash-plugins/logstash-filter-grok/issues/72
# this needs to be refactored and properly fixed
module LogStash::Environment
# also :pattern_path method must exist so we define it too
unless self.method_defined?(:pattern_path)
def pattern_path(path)
::File.join(LOGSTASH_HOME, "patterns", path)
end
end
end

require "logstash/filters/grok"
Expand Down

0 comments on commit 27c6ecc

Please sign in to comment.