=str #19377 improve expectNext() error reporting (if no element signaled)
This commit is contained in:
parent
3f9b8f6dd3
commit
86504ec4e2
1 changed files with 7 additions and 3 deletions
|
|
@ -251,9 +251,13 @@ object TestSubscriber {
|
||||||
/**
|
/**
|
||||||
* Expect and return a stream element.
|
* Expect and return a stream element.
|
||||||
*/
|
*/
|
||||||
def expectNext(): I = probe.receiveOne(probe.remaining) match {
|
def expectNext(): I = {
|
||||||
case OnNext(elem) ⇒ elem.asInstanceOf[I]
|
val t = probe.remaining
|
||||||
case other ⇒ throw new AssertionError("expected OnNext, found " + other)
|
probe.receiveOne(t) match {
|
||||||
|
case null ⇒ throw new AssertionError(s"Expected OnNext(_), yet no element signaled during $t")
|
||||||
|
case OnNext(elem) ⇒ elem.asInstanceOf[I]
|
||||||
|
case other ⇒ throw new AssertionError("expected OnNext, found " + other)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue