airshipctl/cmd/root_test.go
2019-05-24 15:38:59 -05:00

25 lines
466 B
Go

package cmd_test
import (
"bytes"
"os"
"testing"
"github.com/ian-howell/airshipctl/cmd"
"github.com/ian-howell/airshipctl/test"
)
func TestRoot(t *testing.T) {
tt := test.CmdTest{
Name: "default",
CmdLine: "",
}
actual := &bytes.Buffer{}
rootCmd, _, err := cmd.NewRootCmd(actual)
if err != nil {
t.Fatalf("Could not create root command: %s", err.Error())
}
rootCmd.PersistentFlags().Parse(os.Args[1:])
test.RunTest(t, tt, rootCmd, actual)
}