Clean up some things in test_bucket
This commit is contained in:
parent
c816ad70b6
commit
0497afbe57
@ -92,9 +92,7 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
assert f2.installed?
|
assert f2.installed?
|
||||||
assert f3.installed?
|
assert f3.installed?
|
||||||
|
|
||||||
shutup do
|
shutup { Homebrew.cleanup_formula(f3) }
|
||||||
Homebrew.cleanup_formula f3
|
|
||||||
end
|
|
||||||
|
|
||||||
assert !f1.installed?
|
assert !f1.installed?
|
||||||
assert !f2.installed?
|
assert !f2.installed?
|
||||||
@ -113,20 +111,22 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_pathname_plus_yeast
|
def test_pathname_plus_yeast
|
||||||
|
abcd = orig_abcd = HOMEBREW_CACHE+'abcd'
|
||||||
|
|
||||||
shutup do
|
shutup do
|
||||||
assert_nothing_raised do
|
|
||||||
assert !Pathname.getwd.rmdir_if_possible
|
assert !Pathname.getwd.rmdir_if_possible
|
||||||
assert !Pathname.getwd.abv.empty?
|
assert !Pathname.getwd.abv.empty?
|
||||||
|
|
||||||
abcd=orig_abcd=HOMEBREW_CACHE+'abcd'
|
|
||||||
FileUtils.cp ABS__FILE__, abcd
|
FileUtils.cp ABS__FILE__, abcd
|
||||||
installed_paths=HOMEBREW_PREFIX.install abcd
|
installed_paths = HOMEBREW_PREFIX.install(abcd)
|
||||||
|
|
||||||
abcd = installed_paths[0]
|
abcd = installed_paths[0]
|
||||||
assert((HOMEBREW_PREFIX+orig_abcd.basename).exist?)
|
assert((HOMEBREW_PREFIX+orig_abcd.basename).exist?)
|
||||||
assert abcd.exist?
|
assert abcd.exist?
|
||||||
assert_equal HOMEBREW_PREFIX+'abcd', abcd
|
assert_equal HOMEBREW_PREFIX+'abcd', abcd
|
||||||
|
|
||||||
assert_raises(RuntimeError) { abcd.write 'CONTENT' }
|
assert_raises(RuntimeError) { abcd.write 'CONTENT' }
|
||||||
|
|
||||||
abcd.unlink
|
abcd.unlink
|
||||||
abcd.write 'HELLOWORLD'
|
abcd.write 'HELLOWORLD'
|
||||||
assert_equal 'HELLOWORLD', File.read(abcd)
|
assert_equal 'HELLOWORLD', File.read(abcd)
|
||||||
@ -142,10 +142,9 @@ class BeerTasting < Test::Unit::TestCase
|
|||||||
assert orig_abcd.exist?
|
assert orig_abcd.exist?
|
||||||
|
|
||||||
HOMEBREW_CACHE.chmod_R 0777
|
HOMEBREW_CACHE.chmod_R 0777
|
||||||
|
|
||||||
abcd.unlink # teardown
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
abcd.unlink
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_pathname_properties
|
def test_pathname_properties
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user