remove help assertion stuff
This commit is contained in:
parent
d7ec4e8013
commit
60fb297232
15
app_test.go
15
app_test.go
@ -994,17 +994,7 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, test := range tdata {
|
for _, test := range tdata {
|
||||||
t.Run(test.testCase, func(t *testing.T) {
|
t.Run(test.testCase, func(t *testing.T) {
|
||||||
// setup - undo HelpPrinter mock when finished
|
// setup
|
||||||
oldPrinter := HelpPrinter
|
|
||||||
defer func() {
|
|
||||||
HelpPrinter = oldPrinter
|
|
||||||
}()
|
|
||||||
// setup - mock HelpPrinter
|
|
||||||
var helpPrinterWasCalled = false
|
|
||||||
HelpPrinter = func(w io.Writer, template string, data interface{}) {
|
|
||||||
helpPrinterWasCalled = true
|
|
||||||
}
|
|
||||||
// setup - app
|
|
||||||
app := NewApp()
|
app := NewApp()
|
||||||
app.Flags = test.appFlags
|
app.Flags = test.appFlags
|
||||||
app.Commands = test.appCommands
|
app.Commands = test.appCommands
|
||||||
@ -1013,9 +1003,6 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) {
|
|||||||
err := app.Run(test.appRunInput)
|
err := app.Run(test.appRunInput)
|
||||||
|
|
||||||
// assertions
|
// assertions
|
||||||
if helpPrinterWasCalled == false {
|
|
||||||
t.Errorf("HelpPrinter expected to be called, but was not")
|
|
||||||
}
|
|
||||||
if test.expectedAnError && err == nil {
|
if test.expectedAnError && err == nil {
|
||||||
t.Errorf("expected an error, but there was none")
|
t.Errorf("expected an error, but there was none")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user