class Spectator::IterativeExampleGroupBuilder(T)

Overview

Progressively constructs an iterative example group. Hooks and builders for child nodes can be added over time to this builder. When done, call #build to produce an ExampleGroup with nested ExampleGroupIteration instances.

Defined in:

spectator/iterative_example_group_builder.cr

Constructors

Instance Method Summary

Instance methods inherited from class Spectator::ExampleGroupBuilder

<<(builder) <<, after_all(hook : ExampleGroupHook) : Nil
after_all(*args, **kwargs) : Nil
after_all(*args, **kwargs, &block) : Nil
after_all
, after_each(hook : ExampleHook) : Nil
after_each(*args, **kwargs) : Nil
after_each(*args, **kwargs, &block) : Nil
after_each
, around_each(hook : ExampleProcsyHook) : Nil
around_each(*args, **kwargs) : Nil
around_each(*args, **kwargs, &block) : Nil
around_each
, before_all(hook : ExampleGroupHook) : Nil
before_all(*args, **kwargs) : Nil
before_all(*args, **kwargs, &block) : Nil
before_all
, before_each(hook : ExampleHook) : Nil
before_each(*args, **kwargs) : Nil
before_each(*args, **kwargs, &block) : Nil
before_each
, build(parent = nil) build, post_condition(hook : ExampleHook) : Nil
post_condition(*args, **kwargs) : Nil
post_condition(*args, **kwargs, &block) : Nil
post_condition
, pre_condition(hook : ExampleHook) : Nil
pre_condition(*args, **kwargs) : Nil
pre_condition(*args, **kwargs, &block) : Nil
pre_condition

Constructor methods inherited from class Spectator::ExampleGroupBuilder

new(name : Label = nil, location : Location | Nil = nil, metadata : Metadata | Nil = nil) new

Macros inherited from module Spectator::Hooks

define_hook(declaration, order = :append, &block) define_hook

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 U
should(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(collection : Enumerable(T), name : String | Nil = nil, iterators : Array(String) = [] of String, location : Location | Nil = nil, metadata : Metadata | Nil = nil) #

Creates the builder. Initially, the builder will have no children and no hooks. The name, location, and metadata will be applied to the ExampleGroup produced by #build. The collection is the set of items to create sub-nodes for. The iterators is a list of optional names given to items in the collection.


[View source]

Instance Method Detail

def build(parent = nil) #

Constructs an iterative example group with previously defined attributes, children, and hooks. The parent is an already constructed example group to nest the new example group under. It can be nil if the new example group won't have a parent.


[View source]