mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
add an option to bundler_setup! to handle testing environment where development dependencies should not be excluded in order to run proper tests
as a request during review, I made the signature of bundler_setup use the same as invoke_bundler remove empty line in bundler_setup ammend last commit Fixes #2726
This commit is contained in:
parent
4319119e60
commit
d44b58bcdc
2 changed files with 6 additions and 5 deletions
|
@ -90,7 +90,9 @@ module LogStash
|
|||
env.downcase == "test"
|
||||
end
|
||||
|
||||
def bundler_setup!
|
||||
def bundler_setup!(options = {})
|
||||
options = {:without => [:development]}.merge(options)
|
||||
options[:without] = Array(options[:without])
|
||||
# make sure we use our own nicely installed bundler and not a rogue, bad, mean, ugly, stupid other bundler. bad bundler, bad bad bundler go away.
|
||||
Gem.clear_paths
|
||||
Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = logstash_gem_home
|
||||
|
@ -102,8 +104,7 @@ module LogStash
|
|||
require "logstash/bundler"
|
||||
|
||||
::Bundler.settings[:path] = LogStash::Environment::BUNDLE_DIR
|
||||
::Bundler.settings[:without] = "development"
|
||||
|
||||
::Bundler.settings[:without] = options[:without].join(":")
|
||||
# in the context of Bundler.setup it looks like this is useless here because Gemfile path can only be specified using
|
||||
# the ENV, see https://github.com/bundler/bundler/blob/v1.8.3/lib/bundler/shared_helpers.rb#L103
|
||||
::Bundler.settings[:gemfile] = LogStash::Environment::GEMFILE_PATH
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
namespace "test" do
|
||||
def run_rspec(*args)
|
||||
require "logstash/environment"
|
||||
LogStash::Environment.bundler_setup!
|
||||
LogStash::Environment.bundler_setup!({:without => []})
|
||||
require "rspec/core/runner"
|
||||
require "rspec"
|
||||
RSpec::Core::Runner.run([*args])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue