groovyFile writes content to a temp file and returns its path. The file is removed when the current spec ends.
(content string)
| 13 | // groovyFile writes content to a temp file and returns its path. |
| 14 | // The file is removed when the current spec ends. |
| 15 | func 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 | |
| 25 | var _ = Describe("GroovyUtils", func() { |
| 26 | var g *containers.GroovyUtils |
no test coverage detected