aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/unittest.rb
diff options
context:
space:
mode:
authorMax Howell2009-09-21 18:42:24 +0100
committerMax Howell2009-09-21 18:46:28 +0100
commitb51ff87d8e1278abfbea82d0cd4b689248edb0c2 (patch)
treea624b0d9360d5015d48500043ac0289f510ceb9f /Library/Homebrew/unittest.rb
parentf791b4475edd0d6e03103d23d066f1757afb0b72 (diff)
parent68108e109839a901313b9933cbb1e3202aed90cf (diff)
downloadhomebrew-b51ff87d8e1278abfbea82d0cd4b689248edb0c2.tar.bz2
Merge branch 'deps'
Conflicts: Library/Formula/imagemagick.rb Library/Formula/taglib.rb Library/Homebrew/brew.h.rb Library/Homebrew/formula.rb bin/brew
Diffstat (limited to 'Library/Homebrew/unittest.rb')
-rwxr-xr-xLibrary/Homebrew/unittest.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 0b2d7df7f..15336ebde 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -42,7 +42,8 @@ class MostlyAbstractFormula <Formula
end
class TestBall <Formula
- def initialize
+ # name parameter required for some Formula::factory
+ def initialize name=nil
@url="file:///#{Pathname.new(ABS__FILE__).parent.realpath}/testball-0.1.tbz"
super "testball"
end
@@ -123,9 +124,13 @@ def nostdout
end
module ExtendArgvPlusYeast
- def stick_an_arg_in_thar
+ def reset
@named=nil
- unshift 'foo'
+ @formulae=nil
+ @kegs=nil
+ while ARGV.count > 0
+ ARGV.shift
+ end
end
end
ARGV.extend ExtendArgvPlusYeast
@@ -372,8 +377,9 @@ class BeerTasting <Test::Unit::TestCase
end
def test_no_ARGV_dupes
- ARGV.unshift'foo'
- ARGV.unshift'foo'
+ ARGV.reset
+ ARGV.unshift 'foo'
+ ARGV.unshift 'foo'
n=0
ARGV.named.each{|arg| n+=1 if arg == 'foo'}
assert_equal 1, n
@@ -385,9 +391,10 @@ class BeerTasting <Test::Unit::TestCase
assert_raises(UsageError) { ARGV.kegs }
assert ARGV.named_empty?
- (HOMEBREW_CELLAR+'foo'+'0.1').mkpath
+ (HOMEBREW_CELLAR+'mxcl'+'10.0').mkpath
- ARGV.stick_an_arg_in_thar
+ ARGV.reset
+ ARGV.unshift 'mxcl'
assert_equal 1, ARGV.named.length
assert_equal 1, ARGV.kegs.length
assert_raises(FormulaUnavailableError) { ARGV.formulae }
@@ -425,7 +432,7 @@ class BeerTasting <Test::Unit::TestCase
nostdout do
assert_nothing_raised do
f=TestBall.new
- make 'http://example.com/testball-0.1.tbz'
+ make f.url
info f.name
clean f
prune