kotest-assertions / io.kotest.properties / file

file

fun Gen.Companion.file(): Gen<File>
Deprecated: Deprecated and will be removed in 5.0. Migrate to the new property test classes in 4.0

Returns a stream of values where each value is a randomly chosen created File object. The file objects do not necessarily exist on disk.

fun Gen.Companion.file(directoryName: String, recursive: Boolean = false): Gen<File>
Deprecated: Deprecated and will be removed in 5.0. Migrate to the new property test classes in 4.0

Returns a stream of values where each value is a randomly chosen File object from given directory. If the Directory does not exist, an empty sequence will be returned instead. If recursive is true(default value is false) it gives files from inner directories as well recursively.