diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-05-14 16:43:48 +0100 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-05-14 16:43:48 +0100 |
commit | 223a69cc9162c09236a9e42e45ee1542a6a40eea (patch) | |
tree | 793f8a46aa59c16144e7222d02c554723e3589ca /test | |
parent | f4bc8c10476a8f4fe350c9946467752e628fcc47 (diff) | |
download | slop-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.rb | 6 |
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 |