struct Spectator::ContextDelegate
- Spectator::ContextDelegate
- Struct
- Value
- Object
Overview
Stores a test context and a method to call within it.
Defined in:
spectator/context_delegate.crConstructors
-
.new(context : Context, method : ContextMethod)
Creates the delegate.
Class Method Summary
-
.null(&block : -> _)
Creates a delegate with a null context.
Instance Method Summary
-
#call
Invokes a method in the test context.
Instance methods inherited from class Object
should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall Ushould(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_not
Constructor Detail
Creates the delegate. The context is the instance of the test context. The method is proc that downcasts context and calls a method on it.
Class Method Detail
def self.null(&block : -> _)
#
Creates a delegate with a null context. The context will be ignored and the block will be executed in its original scope.