+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:
parent
ac8a5bad60
commit
3193eb8009
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue