fun <T : Iterator<*>> Expect<T>.notToHaveNext(): Expect<T>
(source)
Expects that the subject of this
expectation (an Iterator) does not have a next element.
val list = listOf(1)
val iterator = list.iterator() // fails as iterator has a next element (has actually one element)
fails {
expect(iterator).notToHaveNext()
}
iterator.next() // returns the next element in iteration
expect(iterator).notToHaveNext() // returns the next element in iteration
Return
an Expect for the subject of this
expectation.
Since
0.17.0