Spectator::MockRegistry
Inherits Reference / Object
Stores collections of stubs for mocked types.
This type is intended for all mocked modules that have functionality "injected." That is, the type itself has mock functionality bolted on. Adding instance members should be avoided, for instance, it could mess up serialization.
Instance methods
fetch(object : Reference, & : -> Array(Stub))
Retrieves all stubs.
Yields to the block on the first retrieval. This allows a mock to populate the registry with initial stubs.