doc / ch.tutteli.atrium.api.infix.en_GB / aSymbolicLink

aSymbolicLink

object aSymbolicLink : Keyword (source)

A helper construct to allow expressing expectations about a path being a symbolic link. It can be used for a parameterless function so that it has one parameter and thus can be used as infix function.

val target = tempDir.newFile("target")
val link = Files.createSymbolicLink(tempDir.resolve("link"), target)

// Passes, because subject `link` is a symbolic link
expect(link) toBe aSymbolicLink

val file = tempDir.newFile("somePath")

fails { // because subject `path` is a not a symbolic link
    expect(file) toBe aSymbolicLink
}