Document pre- and post-condition run methods

Mark pre- and post-condition functionality complete in README.
This commit is contained in:
Michael Miller 2019-01-23 15:15:01 -07:00
parent 2f5e59d88b
commit 0af3efea2a
2 changed files with 7 additions and 1 deletions

View file

@ -102,7 +102,7 @@ In no particular order, features that have been implemented and are planned:
- [X] Test multiple and generated values - `sample`, `random_sample`
- [X] Concise syntax - `given`
- [X] Before and after hooks - `before_each`, `before_all`, `after_each`, `after_all`, `around_each`
- [ ] Pre- and post-conditions - `pre_condition`, `post_condition`
- [X] Pre- and post-conditions - `pre_condition`, `post_condition`
- [ ] Other hooks - `on_success`, `on_failure`, `on_error`
- [X] One-liner syntax
- [X] Should syntax - `should`, `should_not`

View file

@ -58,11 +58,17 @@ module Spectator
parent.run_after_each_hooks
end
# Runs all of the pre-condition checks.
# This method should run prior to every example in the group.
# Parent pre-conditions will be checked first.
def run_pre_conditions : Nil
parent.run_pre_conditions
super
end
# Runs all of the post-condition checks.
# This method should run following every example in the group.
# Parent post-conditions will be checked last.
def run_post_conditions : Nil
super
parent.run_post_conditions