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

toBeExecutable

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

Expects that the subject of this expectation (a Path) is executable; meaning that there is a file system entry at the location the Path points to and that the current thread has the permission to execute it.

The semantics of “permission to execute it” may differ when checking access to a directory. For example, on UNIX systems, it means that the Java virtual machine has permission to search the directory in order to access file or subdirectories.

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

val dir = tempDir.newDirectory("test_dir")

expect(dir).toBeExecutable()

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

Return
an Expect for the subject of this expectation.

Since
0.17.0