module Spectator::DSL::Hooks
Overview
DSL methods for adding custom logic to key times of the spec execution.
Direct including types
Defined in:
spectator/dsl/hooks.crMacro Summary
-
after(&block)
Defines a block of code that will be invoked after every example in the group.
-
after_all(&block)
Defines a block of code that will be invoked once after all examples in the group.
-
after_each(&block)
Defines a block of code that will be invoked after every example in the group.
-
after_suite(&block)
Defines a block of code that will be invoked once after all examples in the suite.
-
around(&block)
Defines a block of code that will be invoked around every example in the group.
-
around_each(&block)
Defines a block of code that will be invoked around every example in the group.
-
before(&block)
Defines a block of code that will be invoked before every example in the group.
-
before_all(&block)
Defines a block of code that will be invoked once before any examples in the group.
-
before_each(&block)
Defines a block of code that will be invoked before every example in the group.
-
before_suite(&block)
Defines a block of code that will be invoked once before any examples in the suite.
-
define_example_group_hook(type, name = nil, &block)
Defines a macro to create an example group hook.
-
define_example_hook(type, name = nil, &block)
Defines a macro to create an example hook.
-
post_condition(&block)
Defines a block of code that will be invoked after every example in the group.
-
pre_condition(&block)
Defines a block of code that will be invoked before every example in the group.
Macro Detail
Defines a block of code that will be invoked after every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
Defines a block of code that will be invoked once after all examples in the group.
The block will not run in the context of the current running example.
This means that values defined by let
and subject
are not available.
Defines a block of code that will be invoked after every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
Defines a block of code that will be invoked once after all examples in the suite.
The block will not run in the context of the current running example.
This means that values defined by let
and subject
are not available.
Defines a block of code that will be invoked around every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
The block will execute before the example.
An Example::Procsy
is passed to the block.
The Example::Procsy#run
method should be called to ensure the example runs.
More code can run afterwards (in the block).
Defines a block of code that will be invoked around every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
The block will execute before the example.
An Example::Procsy
is passed to the block.
The Example::Procsy#run
method should be called to ensure the example runs.
More code can run afterwards (in the block).
Defines a block of code that will be invoked before every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
Defines a block of code that will be invoked once before any examples in the group.
The block will not run in the context of the current running example.
This means that values defined by let
and subject
are not available.
Defines a block of code that will be invoked before every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
Defines a block of code that will be invoked once before any examples in the suite.
The block will not run in the context of the current running example.
This means that values defined by let
and subject
are not available.
Defines a macro to create an example group hook.
The type indicates when the hook runs and must be a method on Spectator::DSL::Builder
.
A custom name can be used for the hook method.
If not provided, type will be used instead.
Additionally, a block can be provided.
The block can perform any operations necessary and yield to invoke the end-user hook.
Defines a macro to create an example hook.
The type indicates when the hook runs and must be a method on Spectator::DSL::Builder
.
A custom name can be used for the hook method.
If not provided, type will be used instead.
Additionally, a block can be provided that takes the current example as an argument.
The block can perform any operations necessary and yield to invoke the end-user hook.
Defines a block of code that will be invoked after every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.
Defines a block of code that will be invoked before every example in the group.
The block will be run in the context of the current running example.
This means that values defined by let
and subject
are available.