aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
authorJack Nagel2013-01-19 20:45:58 -0600
committerJack Nagel2013-01-21 17:24:12 -0600
commit452e79cf6866ba2bf60110881680bc811aa8308e (patch)
tree4458b449ac8a87df6249778fff0f55f18c35b46e /Library/Homebrew/test/testing_env.rb
parent09d4a7fb36de59839adbade95ae28681b219a2b3 (diff)
downloadbrew-452e79cf6866ba2bf60110881680bc811aa8308e.tar.bz2
Allow satisfied? to be specified in a block
Instead of overriding #satisfied?, Requirement subclasses can specify the condition in a block: satisfy do some_condition? end The contents of the block are evaluated in the context of the instance, and so have access to instance variables and instance methods as before. Additionally, it is wrapped in an ENV.with_build_environment block. This can be disabled by passing :build_env => false to satisfy: satisfy :build_env => false do some_condition? end
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
-rw-r--r--Library/Homebrew/test/testing_env.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 2380400ea..7206a71f0 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -31,7 +31,11 @@ MACOS = true
MACOS_VERSION = 10.6
MACOS_FULL_VERSION = '10.6.8'
-(HOMEBREW_PREFIX+'Library/Formula').mkpath
+%w{Library/Formula Library/ENV}.each do |d|
+ HOMEBREW_REPOSITORY.join(d).mkpath
+end
+
+ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| Pathname.new(p).expand_path rescue nil }.compact.freeze
at_exit { HOMEBREW_PREFIX.parent.rmtree }