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
commit0d28b0566d69fdd6e08026099009ada77632dd21 (patch)
treef99749a0fe3f13237b4be8d38eddd2de0f9c7609 /Library
parentad9d41a7feda733df0428e59af318f0787537681 (diff)
downloadhomebrew-0d28b0566d69fdd6e08026099009ada77632dd21.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