struct

Athena::Mercure::Spec::MockHub

Inherits Athena::Mercure::Hub::Interface < Struct < Value < Object

Similar to AMC::Hub but does not make any requests to a real Mercure hub. Instead, it accepts a block that can be used to make assertions against the related AMC::Update, and is expected to return the id of the related update.

Constructors

new(url : String, token_provider : AMC::TokenProvider::Interface, public_url : String | Nil = nil, token_factory : AMC::TokenFactory::Interface | Nil = nil, &publisher : AMC::Update -> String)
Source

Instance methods

public_url

Returns the public URL of this hub used to subscribe.

Source
publish(update : AMC::Update) : String

Publishes the provided update to this hub.

Source
token_factory

Returns the AMC::TokenFactory::Interface associated with this hub.

Source
token_provider

Returns the AMC::TokenProvider::Interface associated with this hub.

Source
url

Returns the internal URL of this hub used to publish updates.

Source