diff options
author | Lee Jarvis <lee@jarvis.co> | 2012-01-30 11:28:45 +0000 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2012-01-30 11:28:45 +0000 |
commit | 2e4529aa32c89ffbfb780ce39b0b41c3838de0a8 (patch) | |
tree | fba35b6c18e46d5e6fda36be55e691b0a0f4907c /test | |
parent | 60c2a9246155206d4d5ddca750a51859ca8ad42a (diff) | |
download | slop-2e4529aa32c89ffbfb780ce39b0b41c3838de0a8.tar.gz |
fix option terminator parsing
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index c557891..82aaad4 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -177,6 +177,13 @@ class SlopTest < TestCase refute opts.fetch_option(:baz).expects_argument? end + test "option terminator" do + opts = Slop.new { on :foo= } + items = %w' foo -- --foo bar ' + opts.parse! items + assert_equal %w' foo --foo bar ', items + end + test "raising an InvalidArgumentError when the argument doesn't match" do opts = Slop.new { on :foo=, :match => /^[a-z]+$/ } assert_raises(Slop::InvalidArgumentError) { opts.parse %w' --foo b4r '} |