airshipctl/cmd/version_test.go

29 lines
499 B
Go
Raw Normal View History

2019-04-29 13:35:13 -05:00
package cmd_test
import (
"testing"
"opendev.org/airship/airshipctl/cmd"
"opendev.org/airship/airshipctl/testutil"
2019-04-29 13:35:13 -05:00
)
func TestVersion(t *testing.T) {
rootCmd, _, err := cmd.NewRootCmd(nil)
2019-05-24 15:38:59 -05:00
if err != nil {
t.Fatalf("Could not create root command: %s", err.Error())
}
rootCmd.AddCommand(cmd.NewVersionCommand())
cmdTests := []*testutil.CmdTest{
{
Name: "version",
CmdLine: "version",
Cmd: rootCmd,
},
}
for _, tt := range cmdTests {
testutil.RunTest(t, tt)
}
2019-04-29 13:35:13 -05:00
}