class

Spectator::IterativeExampleGroupBuilder(T)

Inherits Spectator::ExampleGroupBuilder / Spectator::Hooks / Spectator::NodeBuilder / Reference / Object

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.

Constructors

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.

Source

Instance methods

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.

Source