mirror of
https://github.com/spf13/cobra
synced 2024-11-10 15:57:09 +00:00
Updated test corresponding to #49
This commit is contained in:
parent
c36f627ba6
commit
bd75ea1d19
1 changed files with 4 additions and 4 deletions
|
@ -461,7 +461,7 @@ func TestRootHelp(t *testing.T) {
|
||||||
x := fullSetupTest("--help")
|
x := fullSetupTest("--help")
|
||||||
|
|
||||||
checkResultContains(t, x, "Available Commands:")
|
checkResultContains(t, x, "Available Commands:")
|
||||||
checkResultContains(t, x, "for more information about that command")
|
checkResultContains(t, x, "for more information about a command")
|
||||||
|
|
||||||
if strings.Contains(x.Output, "unknown flag: --help") {
|
if strings.Contains(x.Output, "unknown flag: --help") {
|
||||||
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
||||||
|
@ -470,7 +470,7 @@ func TestRootHelp(t *testing.T) {
|
||||||
x = fullSetupTest("echo --help")
|
x = fullSetupTest("echo --help")
|
||||||
|
|
||||||
checkResultContains(t, x, "Available Commands:")
|
checkResultContains(t, x, "Available Commands:")
|
||||||
checkResultContains(t, x, "for more information about that command")
|
checkResultContains(t, x, "for more information about a command")
|
||||||
|
|
||||||
if strings.Contains(x.Output, "unknown flag: --help") {
|
if strings.Contains(x.Output, "unknown flag: --help") {
|
||||||
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
||||||
|
@ -482,7 +482,7 @@ func TestRootNoCommandHelp(t *testing.T) {
|
||||||
x := rootOnlySetupTest("--help")
|
x := rootOnlySetupTest("--help")
|
||||||
|
|
||||||
checkResultOmits(t, x, "Available Commands:")
|
checkResultOmits(t, x, "Available Commands:")
|
||||||
checkResultOmits(t, x, "for more information about that command")
|
checkResultOmits(t, x, "for more information about a command")
|
||||||
|
|
||||||
if strings.Contains(x.Output, "unknown flag: --help") {
|
if strings.Contains(x.Output, "unknown flag: --help") {
|
||||||
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
||||||
|
@ -491,7 +491,7 @@ func TestRootNoCommandHelp(t *testing.T) {
|
||||||
x = rootOnlySetupTest("echo --help")
|
x = rootOnlySetupTest("echo --help")
|
||||||
|
|
||||||
checkResultOmits(t, x, "Available Commands:")
|
checkResultOmits(t, x, "Available Commands:")
|
||||||
checkResultOmits(t, x, "for more information about that command")
|
checkResultOmits(t, x, "for more information about a command")
|
||||||
|
|
||||||
if strings.Contains(x.Output, "unknown flag: --help") {
|
if strings.Contains(x.Output, "unknown flag: --help") {
|
||||||
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
|
||||||
|
|
Loading…
Reference in a new issue