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

toExist

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

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

This assertion resolves symbolic links. Therefore, if a symbolic link exists at the location the subject points to, then the search will continue at that location.

val dir = tempDir.newDirectory("test_dir")

expect(dir).toExist()

fails {
    expect(Paths.get("non_existing_dir")).toExist()
}

Return
an Expect for the subject of this expectation.

Since
0.17.0