diff --git a/README.md b/README.md index 1fc5ef4..c8d903a 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/src/spectator/nested_example_group.cr b/src/spectator/nested_example_group.cr index f0e6c0f..a6d82e6 100644 --- a/src/spectator/nested_example_group.cr +++ b/src/spectator/nested_example_group.cr @@ -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