Skip to content
Myr

Updated test corresponding to #49

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kartik Singhal · committed by spf13 · parent c36f627 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:cobra_test.go+4 added-4 removed
459 unmodified lines
460func TestRootHelp(t *testing.T) {461 x := fullSetupTest("--help")462463 checkResultContains(t, x, "Available Commands:")464 checkResultContains(t, x, "for more information about that command")464 checkResultContains(t, x, "for more information about a command")465466 if strings.Contains(x.Output, "unknown flag: --help") {467 t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)468 }469470 x = fullSetupTest("echo --help")471472 checkResultContains(t, x, "Available Commands:")473 checkResultContains(t, x, "for more information about that command")473 checkResultContains(t, x, "for more information about a command")474475 if strings.Contains(x.Output, "unknown flag: --help") {476 t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)477 }
3 unmodified lines
481func TestRootNoCommandHelp(t *testing.T) {482 x := rootOnlySetupTest("--help")483484 checkResultOmits(t, x, "Available Commands:")485 checkResultOmits(t, x, "for more information about that command")485 checkResultOmits(t, x, "for more information about a command")486487 if strings.Contains(x.Output, "unknown flag: --help") {488 t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)489 }490491 x = rootOnlySetupTest("echo --help")492493 checkResultOmits(t, x, "Available Commands:")494 checkResultOmits(t, x, "for more information about that command")494 checkResultOmits(t, x, "for more information about a command")495496 if strings.Contains(x.Output, "unknown flag: --help") {497 t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)498 }
55 unmodified lines