class Spectator::ExampleGroupHook

Overview

Information about a hook tied to an example group and a proc to invoke it.

Defined in:

spectator/example_group_hook.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Constructor Detail

def self.new(proc : -> , *, location : Location? = nil, label : Label = nil) #

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.


[View source]
def self.new(*, location : Location? = nil, label : Label = nil, &block : -> _) #

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.


[View source]

Instance Method Detail

def call : Nil #

Invokes the hook.


[View source]
def call_once : Bool #

Invokes the hook if it hasn't already been invoked. Returns true if the hook was invoked (first time being called).


[View source]
def label : Label #

User-defined description of the hook.


[View source]
def label? : Label? #

User-defined description of the hook.


[View source]
def location : Location #

Location of the hook in source code.


[View source]
def location? : Location? #

Location of the hook in source code.


[View source]
def to_s(io) #

Produces the string representation of the hook. Includes the location and label if they're not nil.


[View source]