Handle failures in temporary_install better
This commit is contained in:
parent
1beefdb5d0
commit
4c0d2c2bfb
@ -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
|
||||
begin
|
||||
yield
|
||||
|
||||
# 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
|
||||
ensure
|
||||
keg.unlink
|
||||
keg.uninstall
|
||||
end
|
||||
|
||||
assert !keg.exist?
|
||||
assert !f.installed?
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user