test: tmpdir can be a test helper

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2023-05-25 13:54:26 +01:00
parent 7cef021a8a
commit d03e93f6f1
2 changed files with 7 additions and 7 deletions

View File

@ -148,11 +148,10 @@ RUN cp /etc/foo /etc/bar
FROM scratch
COPY --from=base /etc/bar /bar
`)
dir, err := tmpdir(
dir := tmpdir(
t,
fstest.CreateFile("Dockerfile", dockerfile, 0600),
fstest.CreateFile("foo", []byte("foo"), 0600),
)
require.NoError(t, err)
return dir
}