forked from EngineerBetter/concourse-up
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
39 lines (32 loc) · 1.11 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("concourse-up", func() {
BeforeSuite(func() {
var err error
cliPath, err = Build("github.com/EngineerBetter/concourse-up")
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("Concourse-Up - 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 concourse-up"))
})
})