2019-05-01 15:36:58 -05:00
|
|
|
package cmd_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2019-05-24 08:47:49 -05:00
|
|
|
"github.com/ian-howell/airshipctl/cmd"
|
2019-05-24 13:39:37 -05:00
|
|
|
"github.com/ian-howell/airshipctl/test"
|
2019-05-01 15:36:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestRoot(t *testing.T) {
|
2019-05-29 15:15:01 -05:00
|
|
|
cmdTests := []*test.CmdTest{
|
2019-05-30 10:02:54 -05:00
|
|
|
{
|
2019-05-29 15:11:55 -05:00
|
|
|
Name: "default",
|
|
|
|
CmdLine: "",
|
|
|
|
},
|
2019-05-24 08:47:49 -05:00
|
|
|
}
|
2019-05-29 15:11:55 -05:00
|
|
|
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())
|
2019-05-24 08:47:49 -05:00
|
|
|
}
|
2019-05-29 15:11:55 -05:00
|
|
|
for _, tt := range cmdTests {
|
|
|
|
test.RunTest(t, tt, rootCmd)
|
|
|
|
}
|
2019-05-01 15:36:58 -05:00
|
|
|
}
|