aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/ARGV+yeast.rb2
-rwxr-xr-xLibrary/Homebrew/unittest.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/Library/Homebrew/ARGV+yeast.rb b/Library/Homebrew/ARGV+yeast.rb
index 92d341254..c61e2d2c2 100644
--- a/Library/Homebrew/ARGV+yeast.rb
+++ b/Library/Homebrew/ARGV+yeast.rb
@@ -17,7 +17,7 @@
#
module HomebrewArgvExtension
def named
- reject {|arg| arg[0..0] == '-'}
+ reject{|arg| arg[0..0] == '-'}.collect{|arg| arg.downcase}.uniq
end
def options
select {|arg| arg[0..0] == '-'}
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 1bee7b3a6..d4339ebad 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -255,4 +255,12 @@ class BeerTasting <Test::Unit::TestCase
assert_raises(RuntimeError) { f.prefix }
nostdout { assert_raises(ExecutionError) { f.brew } }
end
+
+ def test_no_ARGV_dupes
+ ARGV.unshift'foo'
+ ARGV.unshift'foo'
+ n=0
+ ARGV.named.each{|arg| n+=1 if arg == 'foo'}
+ assert_equal 1, n
+ end
end