mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add note about using pre- and post-conditions
This commit is contained in:
parent
ec9416285b
commit
6c8ec7953a
1 changed files with 20 additions and 0 deletions
|
@ -912,6 +912,10 @@ module Spectator::DSL
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
|
# NOTE: Pre-conditions should not be checked in a `#before_all` or related block.
|
||||||
|
# Errors that occur in a `#before_all` block will halt testing and abort with an error.
|
||||||
|
# Use `#pre_condition` instead for pre-test checks.
|
||||||
|
#
|
||||||
# See also: `#before_each`, `#after_all`, `#after_each`, and `#around_each`.
|
# See also: `#before_each`, `#after_all`, `#after_each`, and `#around_each`.
|
||||||
macro before_all(&block)
|
macro before_all(&block)
|
||||||
::Spectator::DSL::Builder.add_before_all_hook {{block}}
|
::Spectator::DSL::Builder.add_before_all_hook {{block}}
|
||||||
|
@ -963,6 +967,10 @@ module Spectator::DSL
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
|
# NOTE: Pre-conditions should not be checked in a `#before_each` or related block.
|
||||||
|
# Errors that occur in a `#before_each` block will halt testing and abort with an error.
|
||||||
|
# Use `#pre_condition` instead for pre-test checks.
|
||||||
|
#
|
||||||
# See also: `#before_all`, `#after_all`, `#after_each`, and `#around_each`.
|
# See also: `#before_all`, `#after_all`, `#after_each`, and `#around_each`.
|
||||||
macro before_each(&block)
|
macro before_each(&block)
|
||||||
# Before each hook.
|
# Before each hook.
|
||||||
|
@ -1024,6 +1032,10 @@ module Spectator::DSL
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
|
# NOTE: Post-conditions should not be checked in an `#after_all` or related block.
|
||||||
|
# Errors that occur in an `#after_all` block will halt testing and abort with an error.
|
||||||
|
# Use `#post_condition` instead for post-test checks.
|
||||||
|
#
|
||||||
# See also: `#before_all`, `#before_each`, `#after_each`, and `#around_each`.
|
# See also: `#before_all`, `#before_each`, `#after_each`, and `#around_each`.
|
||||||
macro after_all(&block)
|
macro after_all(&block)
|
||||||
::Spectator::DSL::Builder.add_after_all_hook {{block}}
|
::Spectator::DSL::Builder.add_after_all_hook {{block}}
|
||||||
|
@ -1074,6 +1086,10 @@ module Spectator::DSL
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
|
# NOTE: Post-conditions should not be checked in an `#after_each` or related block.
|
||||||
|
# Errors that occur in an `#after_each` block will halt testing and abort with an error.
|
||||||
|
# Use `#post_condition` instead for post-test checks.
|
||||||
|
#
|
||||||
# See also: `#before_all`, `#before_each`, `#after_all`, and `#around_each`.
|
# See also: `#before_all`, `#before_each`, `#after_all`, and `#around_each`.
|
||||||
macro after_each(&block)
|
macro after_each(&block)
|
||||||
# After each hook.
|
# After each hook.
|
||||||
|
@ -1166,6 +1182,10 @@ module Spectator::DSL
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
#
|
#
|
||||||
|
# NOTE: Pre- and post-conditions should not be checked in an `#around_each` or similar block.
|
||||||
|
# Errors that occur in an `#around_each` block will halt testing and abort with an error.
|
||||||
|
# Use `#pre_condition` and `#post_condition` instead for pre- and post-test checks.
|
||||||
|
#
|
||||||
# See also: `#before_all`, `#before_each`, `#after_all`, and `#after_each`.
|
# See also: `#before_all`, `#before_each`, `#after_all`, and `#after_each`.
|
||||||
macro around_each(&block)
|
macro around_each(&block)
|
||||||
# Around each hook.
|
# Around each hook.
|
||||||
|
|
Loading…
Reference in a new issue