toBeRelative

Expects that the subject of this expectation (a Path) is a relative path; meaning that the Path specified in this instance does not start at the file system root.

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

expect(Paths.get("relative/path")).toBeRelative()

fails {
    val s = FileSystems.getDefault().separator
    val prefix = if (s == "\\") "C:" else "" // if (s == "\\") => true current os is windows
    expect(Paths.get("$prefix${s}absolute${s}path")).toBeRelative()
}