aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/support')
-rw-r--r--Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb10
-rw-r--r--Library/Homebrew/test/support/lib/config.rb8
2 files changed, 11 insertions, 7 deletions
diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
index 3a36f1853..ae1854f58 100644
--- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
+++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -89,10 +89,12 @@ RSpec.shared_context "integration test" do
ruby_args << "-rtest/support/helper/integration_mocks"
ruby_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s
- stdout, stderr, status = Open3.capture3(env, RUBY_PATH, *ruby_args, *args)
- $stdout.print stdout
- $stderr.print stderr
- status
+ Bundler.with_original_env do
+ stdout, stderr, status = Open3.capture3(env, RUBY_PATH, *ruby_args, *args)
+ $stdout.print stdout
+ $stderr.print stderr
+ status
+ end
end
def setup_test_formula(name, content = nil)
diff --git a/Library/Homebrew/test/support/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb
index 41f4cbe33..3a0a76722 100644
--- a/Library/Homebrew/test/support/lib/config.rb
+++ b/Library/Homebrew/test/support/lib/config.rb
@@ -2,6 +2,8 @@ unless ENV["HOMEBREW_BREW_FILE"]
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
+require "constants"
+
require "tmpdir"
require "pathname"
@@ -14,9 +16,9 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
end
# Paths pointing into the Homebrew code base that persist across test runs
-HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
-HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
-HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH, ENV["HOMEBREW_GEMS_LOAD_PATH"]].join(":")
+HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
+HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
+HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
# Paths redirected to a temporary directory and wiped at the end of the test run
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")