MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / groovyFile

Function groovyFile

src/java/containers/groovy_utils_test.go:15–23  ·  view source on GitHub ↗

groovyFile writes content to a temp file and returns its path. The file is removed when the current spec ends.

(content string)

Source from the content-addressed store, hash-verified

13// groovyFile writes content to a temp file and returns its path.
14// The file is removed when the current spec ends.
15func groovyFile(content string) string {
16 tmpFile, err := os.CreateTemp("", "test-*.groovy")
17 Expect(err).NotTo(HaveOccurred())
18 DeferCleanup(os.Remove, tmpFile.Name())
19 _, err = tmpFile.WriteString(content)
20 Expect(err).NotTo(HaveOccurred())
21 Expect(tmpFile.Close()).To(Succeed())
22 return tmpFile.Name()
23}
24
25var _ = Describe("GroovyUtils", func() {
26 var g *containers.GroovyUtils

Callers 1

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected