+stk add TestSubscriber/Publisher.Probe.ensureSubscription to allow manual initialization

Otherwise, it is not possible to use `expectNoMsg()` as the first operation.
This commit is contained in:
Johannes Rudolph 2015-10-07 20:00:53 +02:00
parent ac8a5bad60
commit 3193eb8009

View file

@ -137,6 +137,9 @@ object TestPublisher {
private var pendingRequests = initialPendingRequests
private lazy val subscription = expectSubscription()
/** Asserts that a subscription has been received or will be received */
def ensureSubscription(): Unit = subscription // initializes lazy val
/**
* Current pending requests.
*/
@ -558,6 +561,9 @@ object TestSubscriber {
private lazy val subscription = expectSubscription()
/** Asserts that a subscription has been received or will be received */
def ensureSubscription(): Unit = subscription // initializes lazy val
def request(n: Long): Self = {
subscription.request(n)
this