class Spectator::Mocks::Scope
- Spectator::Mocks::Scope
- Reference
- Object
Overview
Provides isolation between logical areas. Each area has its own registry.
Defined in:
spectator/mocks/scope.crConstructors
-
.current : self
Retrieves the active scope.
-
.push : self
Starts a new scope.
Class Method Summary
-
.pop : Nil
Ends a previous scope.
-
.push(& : self -> _)
Starts a new scope for the duration of the block.
Instance Method Summary
-
#registry : Registry
Registry for the scope.
Constructor Detail
def self.push : self
#
Starts a new scope.
#pop
should be called after the scope is no longer needed.
Class Method Detail
def self.push(& : self -> _)
#
Starts a new scope for the duration of the block.
Yields the new scope to the block and returns the value from the block.
#pop
is called automatically as part of this method.