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

Function MakeDirectoryOrFail

dev/devtest/testutils.go:136–144  ·  view source on GitHub ↗

MakeDirectoryOrFail makes a directory or fails the test, returning the path of the directory that was created.

(t *testing.T, path string)

Source from the content-addressed store, hash-verified

134// MakeDirectoryOrFail makes a directory or fails the test, returning the path
135// of the directory that was created.
136func MakeDirectoryOrFail(t *testing.T, path string) func() {
137 if err := os.MkdirAll(path, 0755); err != nil {
138 assert.Fail(t, err.Error())
139 }
140
141 return func() {
142 RemoveDirectoryOrFail(t, path)
143 }
144}
145
146// WithWorkingDirectory executes the passed function within the context of
147// the passed working directory path. If the directory does not exist, panic.

Calls 1

RemoveDirectoryOrFailFunction · 0.85