class Spectator::Config::Builder

Overview

Mutable configuration used to produce a final configuration. Use the setters in this class to incrementally build a configuration. Then call #build to create the final configuration.

Defined in:

spectator/config/builder.cr

Instance Method Summary

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Instance Method Detail

def add_after_all_hook(hook) #

Attaches a hook to be invoked after each top-level example group.


[View source]
def add_after_each_hook(hook) #

Attaches a hook to be invoked after every example. The current example is provided as a block argument.


[View source]
def add_after_suite_hook(hook) #

Attaches a hook to be invoked after all examples in the test suite.


[View source]
def add_around_each_hook(hook) #

Attaches a hook to be invoked around every example. The current example in procsy form is provided as a block argument.


[View source]
def add_before_all_hook(hook) #

Attaches a hook to be invoked before each top-level example group.


[View source]
def add_before_each_hook(hook) #

Attaches a hook to be invoked before every example. The current example is provided as a block argument.


[View source]
def add_before_suite_hook(hook) #

Attaches a hook to be invoked before all examples in the test suite.


[View source]
def add_formatter(formatter : Formatting::Formatter) #

Adds an extra formatter to use for reporting test progress and results.


[View source]
def add_node_filter(filter : NodeFilter) #

Adds a filter to determine which examples can run.


[View source]
def add_node_reject(filter : NodeFilter) #

Adds a filter to prevent examples from running.


[View source]
def after_all(&block) #

Defines a block of code to execute after each top-level example group.


[View source]
def after_each(&block : Example -> _) #

Defines a block of code to execute after every example. The current example is provided as a block argument.


[View source]
def after_suite(&block) #

Defines a block of code to execute after all examples in the test suite.


[View source]
def around_each(&block : Example::Procsy -> _) #

Defines a block of code to execute around every example. The current example in procsy form is provided as a block argument.


[View source]
def before_all(&block) #

Defines a block of code to execute before each top-level example group.


[View source]
def before_each(&block : Example -> _) #

Defines a block of code to execute before every. The current example is provided as a block argument.


[View source]
def before_suite(&block) #

Defines a block of code to execute before all examples in the test suite.


[View source]
def build : Config #

Creates a configuration.


[View source]
def dry_run #

Enables dry-run mode.


[View source]
def dry_run=(flag) #

Enables or disables dry-run mode.


[View source]
def fail_blank #

Enables fail-blank mode (fail on no tests).


[View source]
def fail_blank=(flag) #

Enables or disables fail-blank mode.


[View source]
def fail_fast #

Enables fail-fast mode.


[View source]
def fail_fast=(flag) #

Sets the fail-fast flag.


[View source]
def filter_run_excluding(*tags : Symbol, **values) #

Specifies one or more tags to exclude from running examples.


[View source]
def filter_run_including(*tags : Symbol, **values) #

Specifies one or more tags to constrain running examples to.


[View source]
def filter_run_when_matching(*tags : Symbol, **values) #

Specifies one or more tags to filter on only if they're present in the spec.


[View source]
def formatter=(formatter : Formatting::Formatter) #

Sets the primary formatter to use for reporting test progress and results.


[View source]
def profile #

Displays profiling information


[View source]
def profile=(flag) #

Enables or disables displaying profiling information.


[View source]
def random_seed : UInt64 #

Seed used for random number generation.


[View source]
def random_seed=(random_seed : UInt64) #

Seed used for random number generation.


[View source]
def randomize #

Randomizes test execution order.


[View source]
def randomize=(flag) #

Enables or disables running tests in a random order.


[View source]
def run_flags : Spectator::RunFlags #

Toggles indicating how the test spec should execute.


[View source]
def run_flags=(run_flags) #

Toggles indicating how the test spec should execute.


[View source]