class Spectator::ExampleGroupHook
- Spectator::ExampleGroupHook
- Reference
- Object
Overview
Information about a hook tied to an example group and a proc to invoke it.
Defined in:
spectator/example_group_hook.crConstructors
-
.new(proc : -> , *, location : Location | Nil = nil, label : Label = nil)
Creates the hook with a proc.
-
.new(*, location : Location | Nil = nil, label : Label = nil, &block : -> _)
Creates the hook with a block.
Instance Method Summary
-
#call : Nil
Invokes the hook.
-
#call_once : Bool
Invokes the hook if it hasn't already been invoked.
-
#label : Label
User-defined description of the hook.
-
#label? : Label | Nil
User-defined description of the hook.
-
#location : Location
Location of the hook in source code.
-
#location? : Location | Nil
Location of the hook in source code.
-
#to_s(io : IO) : Nil
Produces the string representation of the hook.
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 hook with a proc. The proc will be called when the hook is invoked. A location and label can be provided for debugging.
Creates the hook with a block. The block will be executed when the hook is invoked. A location and label can be provided for debugging.
Instance Method Detail
Invokes the hook if it hasn't already been invoked. Returns true if the hook was invoked (first time being called).
Produces the string representation of the hook. Includes the location and label if they're not nil.