fix FlowStageSpec (and some boyscouting)
This commit is contained in:
parent
d462cdd1b4
commit
097a10edfc
2 changed files with 63 additions and 78 deletions
|
|
@ -315,6 +315,12 @@ object TestSubscriber {
|
|||
def receiveWhile[T](max: Duration = Duration.Undefined, idle: Duration = Duration.Inf, messages: Int = Int.MaxValue)(f: PartialFunction[SubscriberEvent, T]): immutable.Seq[T] =
|
||||
probe.receiveWhile(max, idle, messages)(f.asInstanceOf[PartialFunction[AnyRef, T]])
|
||||
|
||||
def receiveWithin(max: FiniteDuration, messages: Int = Int.MaxValue): immutable.Seq[I] =
|
||||
probe.receiveWhile(max, max, messages) {
|
||||
case OnNext(i) ⇒ Some(i.asInstanceOf[I])
|
||||
case _ ⇒ None
|
||||
}.flatten
|
||||
|
||||
def within[T](max: FiniteDuration)(f: ⇒ T): T = probe.within(0.seconds, max)(f)
|
||||
|
||||
def onSubscribe(subscription: Subscription): Unit = probe.ref ! OnSubscribe(subscription)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue