toEndWith

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

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

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

expect("ABC") toEndWith "BC"

fails {
    expect("ABC") toEndWith "X"
}
infix fun <T : Path> Expect<T>.toEndWith(expected: Path): Expect<T>(source)

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

Return

an Expect for the subject of this expectation.

Since

0.17.0

Samples

val dir = tempDir.newDirectory("test_dir")

expect(dir) toEndWith Paths.get("test_dir")

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