mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add short before/after hook name
This commit is contained in:
parent
24fd7d1e91
commit
4906dfae0d
1 changed files with 15 additions and 0 deletions
|
@ -124,11 +124,21 @@ module Spectator::DSL
|
||||||
# This means that values defined by `let` and `subject` are available.
|
# This means that values defined by `let` and `subject` are available.
|
||||||
define_example_hook :before_each
|
define_example_hook :before_each
|
||||||
|
|
||||||
|
# :ditto:
|
||||||
|
macro before(&block)
|
||||||
|
before_each {{block}}
|
||||||
|
end
|
||||||
|
|
||||||
# Defines a block of code that will be invoked after every example in the group.
|
# 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.
|
# The block will be run in the context of the current running example.
|
||||||
# This means that values defined by `let` and `subject` are available.
|
# This means that values defined by `let` and `subject` are available.
|
||||||
define_example_hook :after_each
|
define_example_hook :after_each
|
||||||
|
|
||||||
|
# :ditto:
|
||||||
|
macro after(&block)
|
||||||
|
after_each {{block}}
|
||||||
|
end
|
||||||
|
|
||||||
# Defines a block of code that will be invoked around every example in the group.
|
# 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.
|
# The block will be run in the context of the current running example.
|
||||||
# This means that values defined by `let` and `subject` are available.
|
# This means that values defined by `let` and `subject` are available.
|
||||||
|
@ -139,6 +149,11 @@ module Spectator::DSL
|
||||||
# More code can run afterwards (in the block).
|
# More code can run afterwards (in the block).
|
||||||
define_example_hook :around_each
|
define_example_hook :around_each
|
||||||
|
|
||||||
|
# :ditto:
|
||||||
|
macro around(&block)
|
||||||
|
around_each {{block}}
|
||||||
|
end
|
||||||
|
|
||||||
# Defines a block of code that will be invoked before every example in the group.
|
# 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.
|
# The block will be run in the context of the current running example.
|
||||||
# This means that values defined by `let` and `subject` are available.
|
# This means that values defined by `let` and `subject` are available.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue