6 . "github.com/onsi/ginkgo"
7 . "github.com/onsi/gomega"
8 "github.com/onsi/gomega/gexec"
11 var packagePath = "./_fixture/firefly"
13 var _ = Describe(".Build", func() {
14 Context("when there have been previous calls to Build", func() {
16 _, err := gexec.Build(packagePath)
17 Ω(err).ShouldNot(HaveOccurred())
20 It("compiles the specified package", func() {
21 compiledPath, err := gexec.Build(packagePath)
22 Ω(err).ShouldNot(HaveOccurred())
23 Ω(compiledPath).Should(BeAnExistingFile())
26 Context("and CleanupBuildArtifacts has been called", func() {
28 gexec.CleanupBuildArtifacts()
31 It("compiles the specified package", func() {
33 fireflyPath, err = gexec.Build(packagePath)
34 Ω(err).ShouldNot(HaveOccurred())
35 Ω(fireflyPath).Should(BeAnExistingFile())
41 var _ = Describe(".BuildWithEnvironment", func() {
48 It("compiles the specified package with the specified env vars", func() {
49 compiledPath, err := gexec.BuildWithEnvironment(packagePath, env)
50 Ω(err).ShouldNot(HaveOccurred())
51 Ω(compiledPath).Should(BeAnExistingFile())
54 It("returns the environment to a good state", func() {
55 _, err = gexec.BuildWithEnvironment(packagePath, env)
56 Ω(err).ShouldNot(HaveOccurred())
57 Ω(os.Environ()).ShouldNot(ContainElement("GOOS=linux"))