class Spectator::ExampleGroupBuilder
Overview
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
.
Included Modules
Direct Known Subclasses
Defined in:
spectator/example_group_builder.crConstructors
-
.new(name : Label = nil, location : Location | Nil = nil, metadata : Metadata | Nil = nil)
Creates the builder.
Instance Method Summary
-
#<<(builder)
Adds a child builder to the group.
-
#after_all(hook : ExampleGroupHook) : Nil
Registers a new "after_all" hook.
-
#after_all(*args, **kwargs) : Nil
Registers a new "after_all" hook.
-
#after_all(*args, **kwargs, &block) : Nil
Registers a new "after_all" hook.
-
#after_each(hook : ExampleHook) : Nil
Registers a new "after_each" hook.
-
#after_each(*args, **kwargs) : Nil
Registers a new "after_each" hook.
-
#after_each(*args, **kwargs, &block) : Nil
Registers a new "after_each" hook.
-
#around_each(hook : ExampleProcsyHook) : Nil
Registers a new "around_each" hook.
-
#around_each(*args, **kwargs) : Nil
Registers a new "around_each" hook.
-
#around_each(*args, **kwargs, &block) : Nil
Registers a new "around_each" hook.
-
#before_all(hook : ExampleGroupHook) : Nil
Registers a new "before_all" hook.
-
#before_all(*args, **kwargs) : Nil
Registers a new "before_all" hook.
-
#before_all(*args, **kwargs, &block) : Nil
Registers a new "before_all" hook.
-
#before_each(hook : ExampleHook) : Nil
Registers a new "before_each" hook.
-
#before_each(*args, **kwargs) : Nil
Registers a new "before_each" hook.
-
#before_each(*args, **kwargs, &block) : Nil
Registers a new "before_each" hook.
-
#build(parent = nil)
Constructs an example group with previously defined attributes, children, and hooks.
-
#post_condition(hook : ExampleHook) : Nil
Registers a new "post_condition" hook.
-
#post_condition(*args, **kwargs) : Nil
Registers a new "post_condition" hook.
-
#post_condition(*args, **kwargs, &block) : Nil
Registers a new "post_condition" hook.
-
#pre_condition(hook : ExampleHook) : Nil
Registers a new "pre_condition" hook.
-
#pre_condition(*args, **kwargs) : Nil
Registers a new "pre_condition" hook.
-
#pre_condition(*args, **kwargs, &block) : Nil
Registers a new "pre_condition" hook.
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 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
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
.
Instance Method Detail
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.
Registers a new "after_all" hook. The hook will be prepended to the list.
Registers a new "after_all" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleGroupHook.new
.
Registers a new "after_all" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleGroupHook.new
.
Registers a new "after_each" hook. The hook will be prepended to the list.
Registers a new "after_each" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "after_each" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "around_each" hook. The hook will be appended to the list.
Registers a new "around_each" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleProcsyHook.new
.
Registers a new "around_each" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleProcsyHook.new
.
Registers a new "before_all" hook. The hook will be appended to the list.
Registers a new "before_all" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleGroupHook.new
.
Registers a new "before_all" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleGroupHook.new
.
Registers a new "before_each" hook. The hook will be appended to the list.
Registers a new "before_each" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "before_each" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleHook.new
.
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.
Registers a new "post_condition" hook. The hook will be prepended to the list.
Registers a new "post_condition" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "post_condition" hook.
The hook will be prepended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "pre_condition" hook. The hook will be appended to the list.
Registers a new "pre_condition" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleHook.new
.
Registers a new "pre_condition" hook.
The hook will be appended to the list.
A new hook will be created by passing args to ExampleHook.new
.