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

toBeTheInstance

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

Expects that the subject of this expectation is the same instance as expected.

val list = listOf(3)
expect(list) toBeTheInstance list

fails { // because toBeTheInstance is based on identity, use toEqual for equality
    expect(listOf(3)) toBeTheInstance listOf(3)
}

Return
an Expect for the subject of this expectation.

Since
0.17.0