aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-06-12 21:33:55 -0500
committerJack Nagel2014-06-12 21:33:55 -0500
commit4c0d2c2bfb99d91be404e9c05e3b569ffa7dcc39 (patch)
tree86112b093040314ca228ee27ae56da7497f641b7 /Library/Homebrew
parent1beefdb5d06d5ec07714aede24dce020ff6b0b37 (diff)
downloadbrew-4c0d2c2bfb99d91be404e9c05e3b569ffa7dcc39.tar.bz2
Handle failures in temporary_install better
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/test/test_formula_install.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/Library/Homebrew/test/test_formula_install.rb b/Library/Homebrew/test/test_formula_install.rb
index 6e66c0284..75d9d3bac 100644
--- a/Library/Homebrew/test/test_formula_install.rb
+++ b/Library/Homebrew/test/test_formula_install.rb
@@ -10,21 +10,20 @@ class InstallTests < Test::Unit::TestCase
end
def temporary_install f
- # Brew and install the given formula
+ f.prefix.mkpath
+ keg = Keg.new(f.prefix)
+
shutup do
f.brew { f.install }
end
- # Allow the test to do some processing
- yield
+ begin
+ yield
+ ensure
+ keg.unlink
+ keg.uninstall
+ end
- # Remove the brewed formula and double check
- # that it did get removed. This lets multiple
- # tests use the same formula name without
- # stepping on each other.
- keg=Keg.new f.prefix
- keg.unlink
- keg.uninstall
assert !keg.exist?
assert !f.installed?
end