summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <leejarvis@fastmail.com>2018-03-12 13:54:56 +0000
committerLee Jarvis <leejarvis@fastmail.com>2018-03-12 13:56:18 +0000
commitd787c9a60b89e219d0f3791d48b2752b4d92af1d (patch)
tree8ae6103238d4c5c7cf583ae423c9bb0e2c6397b7 /test
parent1241a0ce6b3aca2eb4b31488976b85de9fd8e306 (diff)
downloadslop-d787c9a60b89e219d0f3791d48b2752b4d92af1d.tar.gz
Handle equals character for non-option valuespedantic-equals
If the string includes an equals char but doesn't look like it's a possible candidate for a flag=value, we should ignore it see #226
Diffstat (limited to 'test')
-rw-r--r--test/parser_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parser_test.rb b/test/parser_test.rb
index dcc3661..caee0dd 100644
--- a/test/parser_test.rb
+++ b/test/parser_test.rb
@@ -21,6 +21,11 @@ describe Slop::Parser do
@result.parser.parse %w(--name=bob -p=123)
assert_equal "bob", @result[:name]
assert_equal 123, @result[:port]
+
+ @options.string "--foo"
+ @result.parser.parse %w(--foo = =)
+ assert_equal "=", @result[:foo]
+ assert_equal %w(=), @result.args
end
it "parses arg with leading -" do