class Spectator::PendingExampleBuilder
Overview
Constructs pending examples.
Call #build
to produce an Example
.
Defined in:
spectator/pending_example_builder.crConstructors
-
.new(name : String | Nil = nil, location : Location | Nil = nil, metadata : Metadata | Nil = nil, reason : String | Nil = nil)
Creates the builder.
Instance Method Summary
-
#build(parent = nil)
Constructs an example with previously defined attributes.
Instance methods inherited from class Spectator::NodeBuilder
build(parent = nil)
build
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
def self.new(name : String | Nil = nil, location : Location | Nil = nil, metadata : Metadata | Nil = nil, reason : String | Nil = nil)
#
Creates the builder.
The name, location, and metadata will be applied to the Example
produced by #build
.
A default reason can be given in case the user didn't provide one.
Instance Method Detail
def build(parent = nil)
#
Constructs an example with previously defined attributes. The parent is an already constructed example group to nest the new example under. It can be nil if the new example won't have a parent.