Let the test environment inject its own load path

This commit is contained in:
Jack Nagel 2015-04-28 22:37:27 -04:00
parent 80403db9a1
commit 2ca8172fe9
5 changed files with 11 additions and 3 deletions

View File

@ -9,7 +9,7 @@ module Homebrew
args = %W[
nice #{RUBY_PATH}
-W0
-I #{HOMEBREW_LIBRARY_PATH}
-I #{HOMEBREW_LOAD_PATH}
--
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
#{formula.path}

View File

@ -29,7 +29,7 @@ module Homebrew
args = %W[
#{RUBY_PATH}
-W0
-I #{HOMEBREW_LIBRARY_PATH}
-I #{HOMEBREW_LOAD_PATH}
--
#{HOMEBREW_LIBRARY_PATH}/test.rb
#{f.path}

View File

@ -50,3 +50,9 @@ end
HOMEBREW_LOGS = Pathname.new(ENV['HOMEBREW_LOGS'] || '~/Library/Logs/Homebrew/').expand_path
HOMEBREW_TEMP = Pathname.new(ENV.fetch('HOMEBREW_TEMP', '/tmp'))
if not defined? HOMEBREW_LIBRARY_PATH
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent.join("Homebrew")
end
HOMEBREW_LOAD_PATH = HOMEBREW_LIBRARY_PATH

View File

@ -472,7 +472,7 @@ class FormulaInstaller
args = %W[
nice #{RUBY_PATH}
-W0
-I #{HOMEBREW_LIBRARY_PATH}
-I #{HOMEBREW_LOAD_PATH}
--
#{HOMEBREW_LIBRARY_PATH}/build.rb
#{formula.path}

View File

@ -11,6 +11,8 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
HOMEBREW_LIBRARY_PATH = File.expand_path("../../..", __FILE__)
HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache"
HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar"