Stabilize resource management
This issue lists use-cases and thoughts related to them.
Reading resources
Proposed syntax:
val myResource by resource("text.csv").read()
test("…") {
database().loadFrom(myResource())
}
Proposed module: compat-filesystem
.
Using resources as expected values
Proposed syntax:
val myResource = resource("text.csv")
test("…") {
val actual: String = …
myResource.verify(actual)
}
There should be two different modes:
- By default: compares the contents of the file with the passed value.
- 'Write mode': writes the 'actual' value to the file, creating it if it doesn't exist. (useful when functionality changes)
Edited by Ivan “CLOVIS” Canet