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

toStartWith

infix fun <T : CharSequence> Expect<T>.toStartWith(expected: CharSequence): Expect<T> (source)

Expects that the subject of this expectation (a CharSequence) starts with expected.

expect("ABC") toStartWith "AB"

fails {
    expect("ABC") toStartWith "X"
}

Return
an Expect for the subject of this expectation.

Since
0.17.0

infix fun <T : Path> Expect<T>.toStartWith(expected: Path): Expect<T> (source)

Expects that the subject of this expectation (a Path) starts with the expected.

val dir = tempDir.newDirectory("test_dir")

expect(dir) toStartWith dir.parent

fails {
    expect(dir) toStartWith Paths.get("non_existing_dir")
}

Return
an Expect for the subject of this expectation.

Since
0.17.0