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

24 lines
475 B
Go

package cmd_test
import (
"bytes"
"testing"
"github.com/ian-howell/airshipctl/cmd"
"github.com/ian-howell/airshipctl/test"
)
func TestVersion(t *testing.T) {
tt := test.CmdTest{
Name: "version",
CmdLine: "version",
}
actual := &bytes.Buffer{}
rootCmd, _, err := cmd.NewRootCmd(actual)
if err != nil {
t.Fatalf("Could not create root command: %s", err.Error())
}
rootCmd.AddCommand(cmd.NewVersionCommand(actual))
test.RunTest(t, tt, rootCmd, actual)
}