Skip to content

Commit

Permalink
Added new test
Browse files Browse the repository at this point in the history
  • Loading branch information
akhoury6 committed Apr 18, 2024
1 parent 7849ab5 commit 510d78b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/optimist/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,13 @@ def test_accepts_arguments_with_spaces
assert_equal 0, @p.leftovers.size
end

def test_multi_args_default_to_zero
def test_multi_args_with_specified_type_defaults_to_empty_array
@p.opt :arg1, "arg", :type => :string, :multi => true
opts = @p.parse []
assert_equal [], opts[:arg1]
end

def test_multi_args_with_type_flag_defaults_to_zero
@p.opt :arg1, "arg", :multi => true
opts = @p.parse []
assert_equal 0, opts[:arg1]
Expand Down

0 comments on commit 510d78b

Please sign in to comment.