diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/types_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/types_test.rb b/test/types_test.rb index e060df5..1716776 100644 --- a/test/types_test.rb +++ b/test/types_test.rb @@ -57,6 +57,7 @@ describe Slop::ArrayOption do @options = Slop::Options.new @files = @options.array "--files" @delim = @options.array "-d", delimiter: ":" + @limit = @options.array "-l", limit: 2 @result = @options.parse %w(--files foo.txt,bar.rb) end @@ -77,6 +78,11 @@ describe Slop::ArrayOption do @result.parser.reset.parse %w(-d foo.txt:bar.rb) assert_equal %w(foo.txt bar.rb), @result[:d] end + + it "can use a custom limit" do + @result.parser.reset.parse %w(-l foo,bar,baz) + assert_equal ["foo", "bar,baz"], @result[:l] + end end describe Slop::NullOption do |