doc / ch.tutteli.atrium.api.fluent.en_GB / toBeAnEmptyDirectory

toBeAnEmptyDirectory

fun <T : Path> Expect<T>.toBeAnEmptyDirectory(): Expect<T> (source)

Expects that the subject of this expectation (a Path) is an empty directory; meaning that there is a file system entry at the location the Path points to and that is an empty directory.

val dir = tempDir.newDirectory("test_dir")
expect(dir).toBeAnEmptyDirectory()

dir.newFile("test_file.txt")
fails {
    expect(dir).toBeAnEmptyDirectory()
}

Return
an Expect for the subject of this expectation.

Since
0.17.0