aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2014-08-29 19:38:32 -0500
committerJack Nagel2014-08-29 19:38:32 -0500
commitb14851903c258b62968581f26ab9537f89b37456 (patch)
tree3db7ca9bbe62f287c6860d2cb38bbc73109702e9 /Library/Homebrew/test
parent6885f588d024839f1f49df0859a682e0e9963e04 (diff)
downloadbrew-b14851903c258b62968581f26ab9537f89b37456.tar.bz2
Add a method for retrieving only flags from ARGV
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_ARGV.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_ARGV.rb b/Library/Homebrew/test/test_ARGV.rb
index 7403acf7c..fe50621cd 100644
--- a/Library/Homebrew/test/test_ARGV.rb
+++ b/Library/Homebrew/test/test_ARGV.rb
@@ -30,6 +30,11 @@ class ArgvExtensionTests < Homebrew::TestCase
assert_equal %w[--foo -vds], @argv.options_only
end
+ def test_flags_only
+ @argv << "--foo" << "-vds" << "a" << "b" << "cdefg"
+ assert_equal %w[--foo], @argv.flags_only
+ end
+
def test_empty_argv
assert_empty @argv.named
assert_empty @argv.kegs