summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2013-05-14 16:43:48 +0100
committerLee Jarvis <ljjarvis@gmail.com>2013-05-14 16:43:48 +0100
commit223a69cc9162c09236a9e42e45ee1542a6a40eea (patch)
tree793f8a46aa59c16144e7222d02c554723e3589ca /test
parentf4bc8c10476a8f4fe350c9946467752e628fcc47 (diff)
downloadslop-223a69cc9162c09236a9e42e45ee1542a6a40eea.tar.gz
Ensure grouping multiple options still consumes trailing argument
Parsing `-abc foo` should assign `foo` to the `c` option. closes #114
Diffstat (limited to 'test')
-rw-r--r--test/slop_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index 1ed41cf..856a58b 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -247,6 +247,12 @@ class SlopTest < TestCase
assert_equal %w'foo', args
end
+ test "multiple options should still accept trailing arguments" do
+ opts = Slop.new { on :a; on :b= }
+ opts.parse %w'-ab foo'
+ assert_equal 'foo', opts[:b]
+ end
+
test "setting/getting the banner" do
opts = Slop.new :banner => 'foo'
assert_equal 'foo', opts.banner