airshipctl/cmd/version_test.go

24 lines
475 B
Go
Raw Normal View History

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