class Movie::Streams::Typed::TestSubscriberProbe(T)

Overview

Materialized control for a TestSinks probe. The probe exposes elements only after explicit demand while terminal events remain observable.

Defined in:

movie/streams/testkit.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(default_timeout : Time::Span = TESTKIT_DEFAULT_TIMEOUT) #

[View source]

Instance Method Detail

def await_demand : Nil #

Internal TestSink hook: blocks until one unit of demand is available.


[View source]
def cancel_from_runtime(error : Exception = StreamCancelledError.new("test subscriber runtime stopped")) : Nil #

Internal runtime hook used to release a probe blocked on demand or an unconsumed assertion event.


[View source]
def expect_complete(*, timeout : Time::Span = @default_timeout) : self #

[View source]
def expect_error(type : E.class, *, timeout : Time::Span = @default_timeout) : E forall E #

[View source]
def expect_error(*, timeout : Time::Span = @default_timeout) : Exception #

[View source]
def expect_next(expected : T, *, timeout : Time::Span = @default_timeout) : self #

[View source]
def expect_next(*, timeout : Time::Span = @default_timeout) : T #

[View source]
def expect_no_message(duration : Time::Span = 100.milliseconds) : self #

[View source]
def publish(event : StreamEvent(T)) : Nil #

Internal TestSink hook.


[View source]
def request(n : Int32) : self #

[View source]
def request(n : UInt64) : self #

[View source]