update test names
This commit is contained in:
parent
95d3a8624d
commit
7b9e16b6b5
10
app_test.go
10
app_test.go
@ -882,13 +882,14 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
testCase string
|
testCase string
|
||||||
appFlags []Flag
|
appFlags []Flag
|
||||||
appRunInput []string
|
appRunInput []string
|
||||||
|
appCommands []Command
|
||||||
expectedAnError bool
|
expectedAnError bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
// expectations:
|
// expectations:
|
||||||
// - empty input, when a required flag is present, shows the help message
|
// - empty input, when a required flag is present, shows the help message
|
||||||
// - empty input, when a required flag is present, errors and shows the flag error message
|
// - empty input, when a required flag is present, errors and shows the flag error message
|
||||||
testCase: "empty_input_with_required_flag",
|
testCase: "error_case_empty_input_with_required_flag",
|
||||||
appRunInput: []string{"myCLI"},
|
appRunInput: []string{"myCLI"},
|
||||||
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
||||||
expectedAnError: true,
|
expectedAnError: true,
|
||||||
@ -897,7 +898,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
// expectations:
|
// expectations:
|
||||||
// - inputing --help, when a required flag is present, shows the help message
|
// - inputing --help, when a required flag is present, shows the help message
|
||||||
// - inputing --help, when a required flag is present, does not error
|
// - inputing --help, when a required flag is present, does not error
|
||||||
testCase: "help_input_with_required_flag",
|
testCase: "valid_case_help_input_with_required_flag",
|
||||||
appRunInput: []string{"myCLI", "--help"},
|
appRunInput: []string{"myCLI", "--help"},
|
||||||
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
||||||
},
|
},
|
||||||
@ -905,13 +906,13 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
// expectations:
|
// expectations:
|
||||||
// - giving optional input, when a required flag is present, shows the help message
|
// - 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
|
// - giving optional input, when a required flag is present, errors and shows the flag error message
|
||||||
testCase: "optional_input_with_required_flag",
|
testCase: "error_case_optional_input_with_required_flag",
|
||||||
appRunInput: []string{"myCLI", "--optional", "cats"},
|
appRunInput: []string{"myCLI", "--optional", "cats"},
|
||||||
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}, StringFlag{Name: "optional"}},
|
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}, StringFlag{Name: "optional"}},
|
||||||
expectedAnError: true,
|
expectedAnError: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
testCase: "required_flag_input",
|
testCase: "valid_case_required_flag_input",
|
||||||
appRunInput: []string{"myCLI", "--requiredFlag", "cats"},
|
appRunInput: []string{"myCLI", "--requiredFlag", "cats"},
|
||||||
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
|
||||||
},
|
},
|
||||||
@ -931,6 +932,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
// setup - app
|
// setup - app
|
||||||
app := NewApp()
|
app := NewApp()
|
||||||
app.Flags = test.appFlags
|
app.Flags = test.appFlags
|
||||||
|
app.Commands = test.appCommands
|
||||||
|
|
||||||
// logic under test
|
// logic under test
|
||||||
err := app.Run(test.appRunInput)
|
err := app.Run(test.appRunInput)
|
||||||
|
Loading…
Reference in New Issue
Block a user