airshipctl/cmd/version_test.go
Ian Howell d4dab71f86 Add testing expectations
* Documents the expectations for unit-tests
* Updates the tests to the version command so as to provide a clear
  example of how to test commands.

Change-Id: I3fbb509a2e4298b4ae68200764a6034459b61602
2019-11-07 11:37:53 -06:00

29 lines
450 B
Go

package cmd_test
import (
"testing"
"opendev.org/airship/airshipctl/cmd"
"opendev.org/airship/airshipctl/testutil"
)
func TestVersion(t *testing.T) {
versionCmd := cmd.NewVersionCommand()
cmdTests := []*testutil.CmdTest{
{
Name: "version",
CmdLine: "",
Cmd: versionCmd,
},
{
Name: "version-help",
CmdLine: "--help",
Cmd: versionCmd,
},
}
for _, tt := range cmdTests {
testutil.RunTest(t, tt)
}
}