d4dab71f86
* 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
29 lines
450 B
Go
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)
|
|
}
|
|
}
|