diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-07-25 10:32:52 +0100 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-07-25 10:32:52 +0100 |
commit | 7cfca3fdca18480e06badc68523ea84e1226f0e8 (patch) | |
tree | 6662f06b9e5e5a67ac99ecb35f462dd3eca28388 /test | |
parent | 8c4caa9d5e6fa799087528b60e1acaf37c72de63 (diff) | |
download | slop-7cfca3fdca18480e06badc68523ea84e1226f0e8.tar.gz |
Ensure unknown options are reported for multiple switches
Before this commit we just skipped an option if it wasn't found,
we should instead raise an error.
closes #122
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 856a58b..ece71a6 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -228,6 +228,12 @@ class SlopTest < TestCase assert_raises(Slop::InvalidOptionError) { opts.parse %w'-fabc' } end + test "raising InvalidOptionError for multiple short options" do + opts = Slop.new :strict => true + opts.on :L + assert_raises(Slop::InvalidOptionError) { opts.parse %w'-Ly' } + end + test "multiple_switches is enabled by default" do opts = Slop.new { on :f; on :b } opts.parse %w[ -fb ] |