forked from EngineerBetter/control-tower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
39 lines (32 loc) · 1.12 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main_test
import (
"os/exec"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)
var (
cliPath string
)
var _ = Describe("control-tower", func() {
BeforeSuite(func() {
var err error
cliPath, err = Build("github.com/EngineerBetter/control-tower")
Expect(err).ToNot(HaveOccurred(), "Error building source")
})
AfterSuite(func() {
CleanupBuildArtifacts()
})
It("displays usage instructions on --help", func() {
command := exec.Command(cliPath, "--help")
session, err := Start(command, GinkgoWriter, GinkgoWriter)
Expect(err).ToNot(HaveOccurred(), "Error running CLI: "+cliPath)
Eventually(session).Should(Exit(0))
Expect(session.Out).To(Say("Control-Tower - A CLI tool to deploy Concourse CI"))
Expect(session.Out).To(Say("deploy, d Deploys or updates a Concourse"))
Expect(session.Out).To(Say("destroy, x Destroys a Concourse"))
Expect(session.Out).To(Say("info, i Fetches information on a deployed environment"))
Expect(session.Out).To(Say("maintain, m Handles maintenance operations in control-tower"))
})
})