summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNaoki Mizuno <nigorojr@gmail.com>2015-09-08 15:40:07 -0400
committerNaoki Mizuno <nigorojr@gmail.com>2015-09-08 15:40:07 -0400
commit3df82ee30f7330d8137001c39737c5d7ebf6fcab (patch)
treec18a13bad73e41a4b6b5b4abc85b2f9a30df72fa /test
parentebe678b1639654604b3e54b08ca710c38682b83e (diff)
downloadslop-3df82ee30f7330d8137001c39737c5d7ebf6fcab.tar.gz
Fix bug regarding --foo=bar style options
This fixes the bug introduced in ebe678b1639654604b3e54b08ca710c38682b83e where the argument after a flag is naively deleted. For example, with --foo=bar baz , both `--foo=bar' and `baz' are deleted when only `--foo=bar' should be deleted.
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 bfc4f7e..1099871 100644
--- a/test/parser_test.rb
+++ b/test/parser_test.rb
@@ -71,5 +71,10 @@ describe Slop::Parser do
@parser.parse %w(lee --name lee lee)
assert_equal %w(lee lee), @parser.arguments
end
+
+ it "correctly removes options that use =" do
+ @parser.parse %w(lee --name=lee lee)
+ assert_equal %w(lee lee), @parser.arguments
+ end
end
end