toExist

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.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

val dir = tempDir.newDirectory("test_dir")

expect(dir).toExist()

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