class

Spectator::ExampleConditions

Inherits Reference < Object

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.

Constructors

new(pre_conditions : Array(TestMetaMethod), post_conditions : Array(TestMetaMethod))

Creates a new set of conditions.

Source

Class methods

empty

Creates an empty set of conditions. This will effectively run nothing extra while running a test.

Source

Instance methods

run_post_conditions(wrapper : TestWrapper, example : Example)

Runs all post-condition checks. These should be run after every test.

Source
run_pre_conditions(wrapper : TestWrapper, example : Example)

Runs all pre-condition checks. These should be run before every test.

Source