struct Spectator::TestBlock(ReturnType)

Overview

Captures an block from a test and its label.

Defined in:

spectator/test_block.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from struct Spectator::TestExpression(ReturnType)

label : String label, to_s(io) to_s, value : T value

Constructor methods inherited from struct Spectator::TestExpression(ReturnType)

new(label : String) new

Instance methods inherited from class Object

should(matcher) should, should_eventually(matcher) should_eventually, should_never(matcher) should_never, should_not(matcher) should_not

Constructor Detail

def self.new(proc : -> ReturnType, label : String) #

Creates the block expression with a custom label. Typically the label is the code in the block/proc.


[View source]
def self.new(proc : -> ReturnType) #

Creates the block expression with a generic label. This is used for the "should" syntax and when the label doesn't matter.


[View source]

Class Method Detail

def self.create(proc : -> T, label : String) forall T #

[View source]
def self.create(proc : -> T) forall T #

[View source]

Instance Method Detail

def inspect(io) #

Reports complete information about the expression.


[View source]
def value : ReturnType #

Calls the block and retrieves the value.


[View source]