cleanup subcommand and specs

This commit is contained in:
Lynn Cyrin
2019-07-18 00:47:18 -07:00
parent 300288670f
commit 2299852c3c
2 changed files with 3 additions and 18 deletions

View File

@@ -890,22 +890,13 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
expectedAnError bool
expectedFlagErrorPrinter bool
}{
{
// expectations:
// - empty input shows the help message
// - empty input explicitly does not error
testCase: "empty_input",
appRunInput: []string{""},
expectedHelpPrinter: true,
expectedAnError: false, // explicit false for readability (this is the default value)
},
{
// expectations:
// - empty input, when a required flag is present, shows the help message
// - empty input, when a required flag is present, errors
// - empty input, when a required flag is present, show the flag error message
testCase: "empty_input_with_required_flag",
appRunInput: []string{""},
appRunInput: []string{"command"},
flags: []Flag{StringFlag{Name: "requiredFlag", Required: true}},
expectedHelpPrinter: true,
expectedAnError: true,
@@ -966,12 +957,6 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
Command{
Name: "command",
Flags: test.flags,
Subcommands: []Command{
Command{
Name: "subcommand",
Flags: test.flags,
},
},
},
}