class Spectator::Mocks::Scope

Overview

Provides isolation between logical areas. Each area has its own registry.

Defined in:

spectator/mocks/scope.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.current : self #

Retrieves the active scope.


[View source]
def self.push : self #

Starts a new scope. #pop should be called after the scope is no longer needed.


[View source]

Class Method Detail

def self.pop : Nil #

Ends a previous scope. This should be called for each #push without a block.


[View source]
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.


[View source]

Instance Method Detail

def registry : Registry #

Registry for the scope.


[View source]