File: build_test.go

package info (click to toggle)
golang-gomega 1.0%2Bgit20160910.d59fa0a-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 728 kB
  • ctags: 691
  • sloc: makefile: 12
file content (37 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (2)
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
package gexec_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gexec"
)

var _ = Describe(".Build", func() {
	var packagePath = "./_fixture/firefly"

	Context("when there have been previous calls to Build", func() {
		BeforeEach(func() {
			_, err := gexec.Build(packagePath)
			Ω(err).ShouldNot(HaveOccurred())
		})

		It("compiles the specified package", func() {
			compiledPath, err := gexec.Build(packagePath)
			Ω(err).ShouldNot(HaveOccurred())
			Ω(compiledPath).Should(BeAnExistingFile())
		})

		Context("and CleanupBuildArtifacts has been called", func() {
			BeforeEach(func() {
				gexec.CleanupBuildArtifacts()
			})

			It("compiles the specified package", func() {
				var err error
				fireflyPath, err = gexec.Build(packagePath)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(fireflyPath).Should(BeAnExistingFile())
			})
		})
	})
})