class Spectator::ExampleConditions

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.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

should(matcher : Spectator::Matchers::Matcher) should, should_not(matcher : Spectator::Matchers::Matcher) should_not

Constructor Detail

def self.new(pre_conditions : Array( -> ), post_conditions : Array( -> )) #

Creates a new set of conditions.


[View source]

Class Method Detail

def self.empty #

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


[View source]

Instance Method Detail

def run_post_conditions #

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


[View source]
def run_pre_conditions #

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


[View source]