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, metadata : Metadata = Metadata.new) new

Instance methods inherited from class Spectator::NodeBuilder

build(parent = nil) build

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 self.new(collection : Enumerable(T), name : String? = nil, iterator : String? = nil, location : Location? = nil, metadata : Metadata = Metadata.new) #

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 iterator is an optional name given to a single item 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]