class Spectator::ExampleConditions
- Spectator::ExampleConditions
- Reference
- Object
Overview
Collection of checks that run before and after tests.
The pre-conditions can be used to verify
that the SUT is in an expected state prior to testing.
The post-conditions can be used to verify
that the SUT is in an expected state after tests have finished.
Each check is just a Proc
(code block) that runs when invoked.
Defined in:
spectator/example_conditions.crConstructors
-
.new(pre_conditions : Array(TestMetaMethod), post_conditions : Array(TestMetaMethod))
Creates a new set of conditions.
Class Method Summary
-
.empty
Creates an empty set of conditions.
Instance Method Summary
-
#run_post_conditions(wrapper : TestWrapper, example : Example)
Runs all post-condition checks.
-
#run_pre_conditions(wrapper : TestWrapper, example : Example)
Runs all pre-condition checks.
Instance methods inherited from class Object
should(matcher)
should,
should_eventually(matcher)
should_eventually,
should_never(matcher)
should_never,
should_not(matcher)
should_not
Constructor Detail
Creates a new set of conditions.
Class Method Detail
def self.empty
#
Creates an empty set of conditions. This will effectively run nothing extra while running a test.
Instance Method Detail
Runs all post-condition checks. These should be run after every test.
Runs all pre-condition checks. These should be run before every test.