module Spectator::DSL::Examples
Overview
DSL methods for defining examples and test code.
Included Modules
Direct including types
Defined in:
spectator/dsl/examples.crMacro Summary
-
define_example(name, *tags, **metadata)
Defines a macro to generate code for an example.
-
define_pending_example(name, *tags, **metadata)
Defines a macro to generate code for a pending example.
-
example(what = nil, *tags, **metadata, &block)
Defines an example.
-
fexample(what = nil, *tags, **metadata, &block)
Defines an example.
-
fit(what = nil, *tags, **metadata, &block)
Defines an example.
-
fspecify(what = nil, *tags, **metadata, &block)
Defines an example.
-
it(what = nil, *tags, **metadata, &block)
Defines an example.
-
pending(what = nil, *tags, **metadata, &block)
Defines a pending example.
DEPRECATED Behavior of pending blocks will change in Spectator v0.11.0. Use
skip
instead. -
skip(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
specify(what = nil, *tags, **metadata, &block)
Defines an example.
-
xexample(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
xfexample(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
xfit(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
xfspecify(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
xit(what = nil, *tags, **metadata, &block)
Defines a pending example.
-
xspecify(what = nil, *tags, **metadata, &block)
Defines a pending example.
Macro Detail
Defines a macro to generate code for an example. The name is the name given to the macro.
In addition, another macro is defined that marks the example as pending.
The pending macro is prefixed with 'x'.
For instance, define_example :it
defines it
and xit
.
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 a pending example. The name is the name given to the macro.
The block for the example's content is discarded at compilation time. This prevents issues with undefined methods, signature differences, etc.
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 an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
DEPRECATED Behavior of pending blocks will change in Spectator v0.11.0. Use skip
instead.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines an example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
The example will be marked as pending if the block is omitted. A block or name must be provided.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.
Defines a pending example.
If a block is given, it is treated as the code to test. The block is provided the current example instance as an argument.
The first argument names the example (test). Typically, this specifies what is being tested. It has no effect on the test and is purely used for output. If omitted, a name is generated from the first assertion in the test.
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.