aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-22 14:11:21 -0600
committerJack Nagel2013-01-22 14:11:21 -0600
commitb9e5f1229b61f1e4b90e742f50b267df8a758633 (patch)
tree1b355572ba1fddb2a1b8abb6fac9c174ca568fc0 /Library
parentaed70e50e8305e2f2e0dcb80310e0bec20aee429 (diff)
downloadbrew-b9e5f1229b61f1e4b90e742f50b267df8a758633.tar.bz2
requirements: enable userpaths by default during evaluation
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependencies.rb3
-rw-r--r--Library/Homebrew/test/test_requirement.rb26
2 files changed, 16 insertions, 13 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index adf36c4d9..c60bd3686 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -224,7 +224,6 @@ class Requirement
def satisfy(options={}, &block)
if block_given?
- options[:userpaths] = true if env.userpaths?
@satisfied ||= Requirement::Satisfier.new(options, &block)
else
@satisfied ||= options
@@ -243,7 +242,7 @@ class Requirement
if @options[:build_env]
require 'superenv'
ENV.with_build_environment do
- ENV.userpaths! if @options[:userpaths]
+ ENV.userpaths!
yield @proc
end
else
diff --git a/Library/Homebrew/test/test_requirement.rb b/Library/Homebrew/test/test_requirement.rb
index 0f1cc02de..0319e9e25 100644
--- a/Library/Homebrew/test/test_requirement.rb
+++ b/Library/Homebrew/test/test_requirement.rb
@@ -45,29 +45,33 @@ class RequirementTests < Test::Unit::TestCase
assert !req.satisfied?
end
- def test_satisfy_with_userpaths_from_env
- ENV.expects(:with_build_environment).yields.returns(true)
- ENV.expects(:userpaths!)
+ def test_satisfy_with_boolean
req = Class.new(Requirement) do
- env :userpaths
- satisfy(:build_env => true) { true }
+ satisfy true
end.new
assert req.satisfied?
end
- def test_satisfy_with_userpaths_from_options
- ENV.expects(:with_build_environment).yields.returns(true)
- ENV.expects(:userpaths!)
+ def test_satisfy_sets_up_build_env_by_default
req = Class.new(Requirement) do
- satisfy(:build_env => true, :userpaths => true) { true }
+ env :userpaths
+ satisfy { true }
end.new
+
+ ENV.expects(:with_build_environment).yields.returns(true)
+ ENV.expects(:userpaths!)
+
assert req.satisfied?
end
- def test_satisfy_with_boolean
+ def test_satisfy_build_env_can_be_disabled
req = Class.new(Requirement) do
- satisfy true
+ satisfy(:build_env => false) { true }
end.new
+
+ ENV.expects(:with_build_environment).never
+ ENV.expects(:userpaths!).never
+
assert req.satisfied?
end
end