diff options
| author | Jack Nagel | 2014-06-12 21:33:55 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-12 21:33:55 -0500 |
| commit | 4c0d2c2bfb99d91be404e9c05e3b569ffa7dcc39 (patch) | |
| tree | 86112b093040314ca228ee27ae56da7497f641b7 /Library/Homebrew | |
| parent | 1beefdb5d06d5ec07714aede24dce020ff6b0b37 (diff) | |
| download | brew-4c0d2c2bfb99d91be404e9c05e3b569ffa7dcc39.tar.bz2 | |
Handle failures in temporary_install better
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/test/test_formula_install.rb | 19 |
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 |
