Skip to content

Instantly share code, notes, and snippets.

@npryce
Created October 31, 2018 09:37
Show Gist options
  • Save npryce/96985fcf13c808a2af729085df7d7074 to your computer and use it in GitHub Desktop.
Save npryce/96985fcf13c808a2af729085df7d7074 to your computer and use it in GitHub Desktop.
Minutest Fixtures with Descriptors
class Fixture {
val tempFile: File
}
fixture { testDescriptor ->
Fixture(System.createTempFile(testDescriptor.fullName.joinToString("/"), ".json"))
}
test {
doSomethingThatWritesTo(tempFile)
assertContentsOf(tempFile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment