module Spectator::DSL::Groups
Overview
DSL methods and macros for creating example groups. This module should be included as a mix-in.
Included Modules
Direct including types
Defined in:
spectator/dsl/groups.crMacro Summary
-
context(what, *tags, **metadata, &block)
Defines a new example group.
-
define_example_group(name, *tags, **metadata)
Defines a macro to generate code for an example group.
-
define_iterative_group(name, *tags, **metadata, &block)
Defines a macro to generate code for an iterative example group.
-
describe(what, *tags, **metadata, &block)
Defines a new example group.
-
example_group(what, *tags, **metadata, &block)
Defines a new example group.
-
fcontext(what, *tags, **metadata, &block)
Defines a new example group.
-
fdescribe(what, *tags, **metadata, &block)
Defines a new example group.
-
fexample_group(what, *tags, **metadata, &block)
Defines a new example group.
-
frandom_sample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
-
fsample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
-
random_sample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
-
sample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
-
xcontext(what, *tags, **metadata, &block)
Defines a new example group.
-
xdescribe(what, *tags, **metadata, &block)
Defines a new example group.
-
xexample_group(what, *tags, **metadata, &block)
Defines a new example group.
-
xrandom_sample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
-
xsample(collection, *tags, count = nil, **metadata, &block)
Defines a new iterative example group.
Macro Detail
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a macro to generate code for an example group. The name is the name given to the macro.
Default tags can be provided with tags and metadata. The tags are merged with parent groups. Any items with falsey values from metadata remove the corresponding tag.
Defines a macro to generate code for an iterative example group. The name is the name given to the macro.
Default tags can be provided with tags and metadata. The tags are merged with parent groups. Any items with falsey values from metadata remove the corresponding tag.
If provided, a block can be used to modify collection that will be iterated. It takes a single argument - the original collection from the user. The modified collection should be returned.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new iterative example group.
This type of group duplicates its contents for each element in collection.
This is the same as #sample
except that the items are shuffled.
The items are selected with a RNG based on the seed.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.
Defines a new iterative example group. This type of group duplicates its contents for each element in collection.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.
Defines a new iterative example group.
This type of group duplicates its contents for each element in collection.
This is the same as #sample
except that the items are shuffled.
The items are selected with a RNG based on the seed.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.
Defines a new iterative example group. This type of group duplicates its contents for each element in collection.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new example group. The what argument is a name or description of the group.
The first argument names the example (test). Typically, this specifies what is being tested. This argument is also used as the subject. When it is a type name, it becomes an explicit, which overrides any previous subjects. Otherwise it becomes an implicit subject, which doesn't override explicitly defined subjects.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
TODO Handle string interpolation in example and group names.
Defines a new iterative example group.
This type of group duplicates its contents for each element in collection.
This is the same as #sample
except that the items are shuffled.
The items are selected with a RNG based on the seed.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.
Defines a new iterative example group. This type of group duplicates its contents for each element in collection.
The first argument is the collection of elements to iterate over.
Tags can be specified by adding symbols (keywords) after the first argument. Key-value pairs can also be specified. Any falsey items will remove a previously defined tag.
The number of items iterated can be restricted by specifying a count argument. The first count items will be used if specified, otherwise all items will be used.