diff options
| author | Max Howell | 2009-08-11 01:30:39 +0100 |
|---|---|---|
| committer | Max Howell | 2009-08-11 01:30:39 +0100 |
| commit | 82fa9b71f4c06ef00dcd100977fa0aa49804c9a2 (patch) | |
| tree | b1325599613d5ce2f3cbc65f9eab844f9600a670 | |
| parent | 7b3751940d12a031e0a278f72a9fd5357d97ed7f (diff) | |
| download | homebrew-82fa9b71f4c06ef00dcd100977fa0aa49804c9a2.tar.bz2 | |
More ARGV tests
| -rwxr-xr-x | Library/Homebrew/unittest.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb index 1736a6fa9..22e36847a 100755 --- a/Library/Homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -280,4 +280,18 @@ class BeerTasting <Test::Unit::TestCase ARGV.named.each{|arg| n+=1 if arg == 'foo'} assert_equal 1, n end + + def test_ARGV + assert_raises(UsageError) { ARGV.named } + assert_raises(UsageError) { ARGV.formulae } + assert_raises(UsageError) { ARGV.kegs } + assert ARGV.named_empty? + + (HOMEBREW_CELLAR+'foo'+'0.1').mkpath + + ARGV.unshift 'foo' + assert_equal 1, ARGV.named.length + assert_equal 1, ARGV.kegs.length + assert_raises(FormulaUnavailableError) { ARGV.formulae } + end end |
