Add unit test for root

This commit is contained in:
Ian Howell 2019-05-01 15:36:58 -05:00
parent 2bab338af4
commit 131355333a
3 changed files with 33 additions and 0 deletions

@ -16,6 +16,7 @@ func NewRootCmd(out io.Writer) *cobra.Command {
Use: "airshipadm",
Short: "airshipadm is a unified entrypoint to various airship components",
}
rootCmd.SetOutput(out)
rootCmd.AddCommand(NewVersionCommand(out))

15
cmd/root_test.go Normal file

@ -0,0 +1,15 @@
package cmd_test
import (
"testing"
"github.com/ian-howell/airshipadm/internal/test"
)
func TestRoot(t *testing.T) {
tests := []test.CmdTest{{
Name: "arishipadm root",
Command: "",
}}
test.RunCmdTests(t, tests)
}

17
cmd/testdata/golden/TestRoot.golden vendored Normal file

@ -0,0 +1,17 @@
airshipadm is a unified entrypoint to various airship components
Usage:
airshipadm [command]
Available Commands:
help Help about any command
version Show the version number of airshipadm and its underlying tools
Flags:
-h, --help help for airshipadm
--kubeconfig string path to kubeconfig
Additional help topics:
airshipadm workflow access to workflows
Use "airshipadm [command] --help" for more information about a command.