class

Spectator::ExampleGroupBuilder

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

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

Constructors

new(name : Label = nil, 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.

Source

Instance methods

<<(builder)

Adds a child builder to the group. The builder will have NodeBuilder#build called on it from within #build. The new example group will be passed to it.

Source
after_all(hook : ExampleGroupHook) : Nil

Registers a new &quot;after_all&quot; hook. The hook will be prepended to the list.

Source
after_all(*args, **kwargs) : Nil

Registers a new &quot;after_all&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleGroupHook.new.

Source
after_all(*args, **kwargs, &block) : Nil

Registers a new &quot;after_all&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleGroupHook.new.

Source
after_each(hook : ExampleHook) : Nil

Registers a new &quot;after_each&quot; hook. The hook will be prepended to the list.

Source
after_each(*args, **kwargs) : Nil

Registers a new &quot;after_each&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
after_each(*args, **kwargs, &block) : Nil

Registers a new &quot;after_each&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
around_each(hook : ExampleProcsyHook) : Nil

Registers a new &quot;around_each&quot; hook. The hook will be appended to the list.

Source
around_each(*args, **kwargs) : Nil

Registers a new &quot;around_each&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleProcsyHook.new.

Source
around_each(*args, **kwargs, &block) : Nil

Registers a new &quot;around_each&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleProcsyHook.new.

Source
before_all(hook : ExampleGroupHook) : Nil

Registers a new &quot;before_all&quot; hook. The hook will be appended to the list.

Source
before_all(*args, **kwargs) : Nil

Registers a new &quot;before_all&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleGroupHook.new.

Source
before_all(*args, **kwargs, &block) : Nil

Registers a new &quot;before_all&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleGroupHook.new.

Source
before_each(hook : ExampleHook) : Nil

Registers a new &quot;before_each&quot; hook. The hook will be appended to the list.

Source
before_each(*args, **kwargs) : Nil

Registers a new &quot;before_each&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
before_each(*args, **kwargs, &block) : Nil

Registers a new &quot;before_each&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
build(parent = nil)

Constructs an 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
post_condition(hook : ExampleHook) : Nil

Registers a new &quot;post_condition&quot; hook. The hook will be prepended to the list.

Source
post_condition(*args, **kwargs) : Nil

Registers a new &quot;post_condition&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
post_condition(*args, **kwargs, &block) : Nil

Registers a new &quot;post_condition&quot; hook. The hook will be prepended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
pre_condition(hook : ExampleHook) : Nil

Registers a new &quot;pre_condition&quot; hook. The hook will be appended to the list.

Source
pre_condition(*args, **kwargs) : Nil

Registers a new &quot;pre_condition&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleHook.new.

Source
pre_condition(*args, **kwargs, &block) : Nil

Registers a new &quot;pre_condition&quot; hook. The hook will be appended to the list. A new hook will be created by passing args to ExampleHook.new.

Source