TEST Zip'd archives can be extracted

This commit is contained in:
Max Howell 2009-08-10 18:16:12 +01:00
parent 6661f78618
commit e24e46c793

View File

@ -35,13 +35,21 @@ class TestBall <Formula
@url="file:///#{Pathname.new(__FILE__).parent.realpath}/testball-0.1.tbz" @url="file:///#{Pathname.new(__FILE__).parent.realpath}/testball-0.1.tbz"
super "testball" super "testball"
end end
def install def install
prefix.install "bin" prefix.install "bin"
prefix.install "libexec" prefix.install "libexec"
end end
end end
class TestZip <Formula
def initialize
path=HOMEBREW_CACHE.parent+'test-0.1.zip'
Kernel.system 'zip', '-0', path, __FILE__
@url="file://#{path}"
super 'testzip'
end
end
class TestBallValidMd5 <TestBall class TestBallValidMd5 <TestBall
@md5='71aa838a9e4050d1876a295a9e62cbe6' @md5='71aa838a9e4050d1876a295a9e62cbe6'
end end
@ -261,6 +269,10 @@ class BeerTasting <Test::Unit::TestCase
nostdout { assert_raises(ExecutionError) { f.brew } } nostdout { assert_raises(ExecutionError) { f.brew } }
end end
def test_zip
nostdout { assert_nothing_raised { TestZip.new.brew {} } }
end
def test_no_ARGV_dupes def test_no_ARGV_dupes
ARGV.unshift'foo' ARGV.unshift'foo'
ARGV.unshift'foo' ARGV.unshift'foo'