From 7b9e16b6b5255803ea279fe1ee0e41973f49a42e Mon Sep 17 00:00:00 2001 From: Lynn Cyrin Date: Thu, 1 Aug 2019 20:30:43 -0700 Subject: [PATCH] update test names --- app_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app_test.go b/app_test.go index bbd1426..6f36ef9 100644 --- a/app_test.go +++ b/app_test.go @@ -882,13 +882,14 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) { testCase string appFlags []Flag appRunInput []string + appCommands []Command expectedAnError bool }{ { // expectations: // - 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 - testCase: "empty_input_with_required_flag", + testCase: "error_case_empty_input_with_required_flag", appRunInput: []string{"myCLI"}, appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}}, expectedAnError: true, @@ -897,7 +898,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) { // expectations: // - inputing --help, when a required flag is present, shows the help message // - 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"}, appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}}, }, @@ -905,13 +906,13 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) { // expectations: // - 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: "optional_input_with_required_flag", + testCase: "error_case_optional_input_with_required_flag", appRunInput: []string{"myCLI", "--optional", "cats"}, appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}, StringFlag{Name: "optional"}}, expectedAnError: true, }, { - testCase: "required_flag_input", + testCase: "valid_case_required_flag_input", appRunInput: []string{"myCLI", "--requiredFlag", "cats"}, appFlags: []Flag{StringFlag{Name: "requiredFlag", Required: true}}, }, @@ -931,6 +932,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) { // setup - app app := NewApp() app.Flags = test.appFlags + app.Commands = test.appCommands // logic under test err := app.Run(test.appRunInput)