Skip to content

Commit 02fc8ef

Browse files
committed
* Add more test cases to cover more possible combinations
1 parent b0eccc3 commit 02fc8ef

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

features/builtin_contracts/keyword_args_with_optional_positional_args.feature

+26
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,29 @@ Feature: KeywordArgs when used with optional positional arguments
4848
["c", "d"]
4949
output
5050
"""
51+
52+
Scenario: Accepts arguments when only require arguments & optional keyword arguments filled and valid
53+
Given a file named "accepts_all_filled_valid_args.rb" with:
54+
"""ruby
55+
require "./keyword_args_with_optional_positional_args_usage"
56+
puts Example.new.foo(:output, b: 'd')
57+
"""
58+
When I run `ruby accepts_all_filled_valid_args.rb`
59+
Then output should contain:
60+
"""
61+
["a", "d"]
62+
output
63+
"""
64+
65+
Scenario: Accepts arguments when only require arguments & optional positional arguments filled and valid
66+
Given a file named "accepts_all_filled_valid_args.rb" with:
67+
"""ruby
68+
require "./keyword_args_with_optional_positional_args_usage"
69+
puts Example.new.foo(:output, 'c')
70+
"""
71+
When I run `ruby accepts_all_filled_valid_args.rb`
72+
Then output should contain:
73+
"""
74+
["c", "b"]
75+
output
76+
"""

0 commit comments

Comments
 (0)