update comments

main
Lynn Cyrin 5 years ago
parent ef9acb4a3b
commit fdd4d10691
No known key found for this signature in database
GPG Key ID: EE9CCB427DFEC897

@ -885,8 +885,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
appCommands []Command appCommands []Command
expectedAnError bool expectedAnError bool
}{ }{
// expectations: // assertion: empty input, when a required flag is present, errors
// - empty input, when a required flag is present, errors and shows the flag error message
{ {
testCase: "error_case_empty_input_with_required_flag_on_app", testCase: "error_case_empty_input_with_required_flag_on_app",
appRunInput: []string{"myCLI"}, appRunInput: []string{"myCLI"},
@ -914,8 +913,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
}}, }},
expectedAnError: true, expectedAnError: true,
}, },
// expectations: // assertion: inputing --help, when a required flag is present, does not error
// - inputing --help, when a required flag is present, does not error
{ {
testCase: "valid_case_help_input_with_required_flag_on_app", testCase: "valid_case_help_input_with_required_flag_on_app",
appRunInput: []string{"myCLI", "--help"}, appRunInput: []string{"myCLI", "--help"},
@ -940,9 +938,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
}}, }},
}}, }},
}, },
// expectations: // assertion: giving optional input, when a required flag is present, errors
// - giving optional input, when a required flag is present, shows the help message
// - giving optional input, when a required flag is present, errors and shows the flag error message
{ {
testCase: "error_case_optional_input_with_required_flag_on_app", testCase: "error_case_optional_input_with_required_flag_on_app",
appRunInput: []string{"myCLI", "--optional", "cats"}, appRunInput: []string{"myCLI", "--optional", "cats"},
@ -970,7 +966,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
}}, }},
expectedAnError: true, expectedAnError: true,
}, },
// valid input cases // assertion: when a required flag is present, inputting that required flag does not error
{ {
testCase: "valid_case_required_flag_input_on_app", testCase: "valid_case_required_flag_input_on_app",
appRunInput: []string{"myCLI", "--requiredFlag", "cats"}, appRunInput: []string{"myCLI", "--requiredFlag", "cats"},

Loading…
Cancel
Save