diff options
Diffstat (limited to 'test/parser_test.rb')
-rw-r--r-- | test/parser_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/parser_test.rb b/test/parser_test.rb index ef09714..8ac9345 100644 --- a/test/parser_test.rb +++ b/test/parser_test.rb @@ -28,6 +28,15 @@ describe Slop::Parser do assert_equal %w(=), @result.args end + it "parses flag=''" do + @options.string "--str" + @options.array "--arr", default: ["array"] + @result.parser.parse %(--str="" --arr="").shellsplit + + assert_equal "", @result[:str] + assert_equal [], @result[:arr] + end + it "parses arg with leading -" do @options.string "-t", "--text" @result.parser.parse %w(--name=bob --text --sometext) |