class Spectator::Config

Overview

Provides customization and describes specifics for how Spectator will run and report tests.

Defined in:

spectator/config.cr
spectator/config/builder.cr
spectator/config/cli_arguments_applicator.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should
, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not

Constructor Detail

def self.default : self #

Produces the default configuration.


[View source]
def self.new(source) #

Creates a new configuration. Properties are pulled from source. Typically, source is a Config::Builder.


[View source]

Instance Method Detail

def formatter : Formatting::Formatter #

Primary formatter all events will be sent to.


[View source]
def iterator(group : ExampleGroup) #

Creates an iterator configured to select the filtered examples.


[View source]
def node_filter : NodeFilter #

Filter used to select which examples to run.


[View source]
def node_reject : NodeFilter #

Filter used to select which examples to not run.


[View source]
def random #

Retrieves the configured random number generator. This will produce the same generator with the same seed every time.


[View source]
def random_seed : UInt64 #

Seed used for random number generation.


[View source]
def run_flags : RunFlags #

Flags indicating how the spec should run.


[View source]
def shuffle(items) #

Shuffles the items in an array using the configured random settings. If #randomize? is true, the items are shuffled and returned as a new array. Otherwise, the items are left alone and returned as-is. The array of items is never modified.


[View source]
def shuffle!(items) #

Shuffles the items in an array using the configured random settings. If #randomize? is true, the items are shuffled and returned. Otherwise, the items are left alone and returned as-is. The array of items is modified, the items are shuffled in-place.


[View source]