if i wanted to simulate an open file for testing p...
# getting-started
m
if i wanted to simulate an open file for testing purposes, how could i do that? eg
Copy code
val dest = File("firstfile.txt")
val target = File("somefile.txt")
target.createNewFile()
target.remainOpenTilClosed()
dest.write("test")
assertFailsWith(SomeException::class, "Could not copy to open file") {
    dest.copyTo(target, overwrite = true)
}
target.close()