diff options
Diffstat (limited to 'crashbox-server/src/test/scala/io/crashbox/ci/TestUtil.scala')
-rw-r--r-- | crashbox-server/src/test/scala/io/crashbox/ci/TestUtil.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crashbox-server/src/test/scala/io/crashbox/ci/TestUtil.scala b/crashbox-server/src/test/scala/io/crashbox/ci/TestUtil.scala new file mode 100644 index 0000000..eb177f8 --- /dev/null +++ b/crashbox-server/src/test/scala/io/crashbox/ci/TestUtil.scala @@ -0,0 +1,13 @@ +package io.crashbox.ci + +import java.io.{ File, OutputStream } +import java.nio.file.Files + +object TestUtil { + + def withTempDir[A](f: File => A): A = { + val dir = Files.createTempDirectory("crashbox-test").toFile + try f(dir) finally dir.delete() + } + +} |