diff --git a/circleci_cli_suite_test.go b/circleci_cli_suite_test.go index babd962f8..018298dd8 100644 --- a/circleci_cli_suite_test.go +++ b/circleci_cli_suite_test.go @@ -5,21 +5,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" ) -var pathCLI string - -var _ = BeforeSuite(func() { - var err error - pathCLI, err = gexec.Build("github.com/circleci/circleci-cli") - Ω(err).ShouldNot(HaveOccurred()) -}) - -var _ = AfterSuite(func() { - gexec.CleanupBuildArtifacts() -}) - func TestCircleciCli(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "CircleciCli Suite") diff --git a/cmd/cmd_suite_test.go b/cmd/cmd_suite_test.go new file mode 100644 index 000000000..593f57238 --- /dev/null +++ b/cmd/cmd_suite_test.go @@ -0,0 +1,26 @@ +package cmd_test + +import ( + "testing" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "github.com/onsi/gomega/gexec" +) + +var pathCLI string + +var _ = BeforeSuite(func() { + var err error + pathCLI, err = gexec.Build("github.com/circleci/circleci-cli") + Ω(err).ShouldNot(HaveOccurred()) +}) + +var _ = AfterSuite(func() { + gexec.CleanupBuildArtifacts() +}) + +func TestCmd(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Cmd Suite") +} diff --git a/main_test.go b/cmd/root_test.go similarity index 91% rename from main_test.go rename to cmd/root_test.go index 2ad87f68e..637a8ae6b 100644 --- a/main_test.go +++ b/cmd/root_test.go @@ -1,4 +1,4 @@ -package main_test +package cmd_test import ( "os/exec" @@ -9,7 +9,7 @@ import ( "github.com/onsi/gomega/gexec" ) -var _ = Describe("Main", func() { +var _ = Describe("Root", func() { Describe("when run with --help", func() { It("return exit code 0 with help message", func() { command := exec.Command(pathCLI, "--help")