MCPcopy
hub / github.com/puma/puma-dev / RemoveDirectoryOrFail

Function RemoveDirectoryOrFail

dev/devtest/testutils.go:122–132  ·  view source on GitHub ↗

RemoveDirectoryOrFail removes a directory (and its contents) or fails the test.

(t *testing.T, path string)

Source from the content-addressed store, hash-verified

120
121// RemoveDirectoryOrFail removes a directory (and its contents) or fails the test.
122func RemoveDirectoryOrFail(t *testing.T, path string) {
123 if !DirExists(path) {
124 assert.FailNow(t, fmt.Sprintf("%s does not exist", path))
125 }
126
127 if err := os.RemoveAll(path); err != nil {
128 assert.Fail(t, err.Error())
129 } else {
130 LogDebugf("removed %s\n", path)
131 }
132}
133
134// MakeDirectoryOrFail makes a directory or fails the test, returning the path
135// of the directory that was created.

Callers 3

createTmpDirFunction · 0.92
MakeDirectoryOrFailFunction · 0.85
LinkTestAppsFunction · 0.85

Calls 2

DirExistsFunction · 0.85
LogDebugfFunction · 0.85

Tested by 1

createTmpDirFunction · 0.74