struct Spectator::Example::Procsy


Wraps an example to behave like a Proc. This is typically used for an around_each hook. Invoking #call or #run will run the example.

Defined in:



Instance Method Summary

Macro 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 : Example, &proc : -> ) #

Creates the example proxy. The example should be run eventually. The proc defines the block of code to run when #call or #run is invoked.

[View source]

Instance Method Detail

def call : Nil #

Invokes the proc.

[View source]
def example : Example #

Underlying example that will run.

[View source]
def run : Nil #

Invokes the proc.

[View source]
def wrap(&block : -> ) : self #

Creates a new procsy for a block and the example from this instance.

[View source]

Macro Detail

macro method_missing(call) #

Allow instance to behave like an example.

[View source]