From 96ad9297841968796e1bdf988b0af87854372d65 Mon Sep 17 00:00:00 2001 From: jszwedko Date: Sun, 3 May 2015 18:02:03 -0700 Subject: [PATCH] Add test for inclusion of 'AUTHORS' in App help --- help_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 help_test.go diff --git a/help_test.go b/help_test.go new file mode 100644 index 0000000..bf0b272 --- /dev/null +++ b/help_test.go @@ -0,0 +1,22 @@ +package cli_test + +import ( + "bytes" + "testing" + + "github.com/codegangsta/cli" +) + +func TestShowAppHelp(t *testing.T) { + output := new(bytes.Buffer) + app := cli.NewApp() + app.Writer = output + + c := cli.NewContext(app, nil, nil) + + cli.ShowAppHelp(c) + + if bytes.Index(output.Bytes(), []byte("AUTHOR(S):")) != -1 { + t.Errorf("expected\n%snot to include %s", output.String(), "AUTHOR(S):") + } +}