class

Spectator::ExampleGroup

Inherits Indexable / Enumerable / Iterable / Spectator::Hooks / Spectator::Node / Reference / Object

Collection of examples and sub-groups.

Constructors

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

Creates the example group. The name describes the purpose of the group. It can be a Symbol to describe a type. The location tracks where the group exists in source code. This group will be assigned to the parent group if it is provided. A set of metadata can be used for filtering and modifying example behavior.

Source

Instance methods

<<(node : Node)

Adds the specified node to the group. Assigns the node to this group. If the node already belongs to a group, it will be removed from the previous group before adding it to this group.

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
ascend

Yields this group and all parent groups.

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
delete(node : Node)

Removes the specified node from the group. The node will be unassigned from this group.

Source
finished?

Checks if all examples and sub-groups have finished.

Source
group

Parent group this group belongs to.

Source
group?

Parent group this group belongs to.

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
size(*args, **options)
Source
size(*args, **options, &)
Source
to_s(io : IO, *, nested = false) : Nil

Constructs the full name or description of the example group. This prepends names of groups this group is part of.

Source
unsafe_fetch(*args, **options)
Source
unsafe_fetch(*args, **options, &)
Source