struct Spectator::TestBlock(ReturnType)
Overview
Captures an block from a test and its label.
Defined in:
spectator/test_block.crConstructors
-
.new(proc : -> ReturnType, label : String)
Creates the block expression with a custom label.
-
.new(proc : -> ReturnType)
Creates the block expression with a generic label.
Class Method Summary
Instance Method Summary
-
#inspect(io)
Reports complete information about the expression.
-
#value : ReturnType
Calls the block and retrieves the value.
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.
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.