aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_requirement.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_requirement.rb b/Library/Homebrew/test/test_requirement.rb
index 0319e9e25..e8803ed92 100644
--- a/Library/Homebrew/test/test_requirement.rb
+++ b/Library/Homebrew/test/test_requirement.rb
@@ -74,4 +74,17 @@ class RequirementTests < Test::Unit::TestCase
assert req.satisfied?
end
+
+ def test_infers_path_from_satisfy_result
+ which_path = Pathname.new("/foo/bar/baz")
+ req = Class.new(Requirement) do
+ satisfy { which_path }
+ end.new
+
+ ENV.expects(:with_build_environment).yields.returns(which_path)
+ ENV.expects(:userpaths!)
+ ENV.expects(:append).with("PATH", which_path.parent, ":")
+
+ req.modify_build_environment
+ end
end