struct
Athena::Mercure::Spec::MockHub
- Athena::Mercure::Spec::MockHub
- Struct
- Value
- Object
Overview
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.
Included Modules
Defined in:
spec.crConstructors
Instance Method Summary
-
#public_url : String
Returns the public URL of this hub used to subscribe.
-
#publish(update : AMC::Update) : String
Publishes the provided update to this hub.
-
#token_factory : AMC::TokenFactory::Interface | Nil
Returns the [AMC::TokenFactory::Interface][] associated with this hub.
-
#token_provider : AMC::TokenProvider::Interface
Returns the [AMC::TokenProvider::Interface][] associated with this hub.
-
#url : String
Returns the internal URL of this hub used to publish updates.
Instance methods inherited from module Athena::Mercure::Hub::Interface
public_url : String
public_url,
publish(update : AMC::Update) : String
publish,
token_factory : AMC::TokenFactory::Interface | Nil
token_factory,
token_provider : AMC::TokenProvider::Interface | Nil
token_provider,
url : String
url
Constructor Detail
def self.new(url : String, token_provider : AMC::TokenProvider::Interface, public_url : String | Nil = nil, token_factory : AMC::TokenFactory::Interface | Nil = nil, &publisher : AMC::Update -> String)
#
Instance Method Detail
def token_factory : AMC::TokenFactory::Interface | Nil
#
Returns the [AMC::TokenFactory::Interface][] associated with this hub.
def token_provider : AMC::TokenProvider::Interface
#
Returns the [AMC::TokenProvider::Interface][] associated with this hub.