class

Spectator::Report

Inherits Enumerable < Reference < Object

Outcome of all tests in a suite.

Constructors

new(results : Array(Result), runtime : Time::Span, remaining_count : Int32 = 0, fail_blank : Bool = false, random_seed : UInt64 | Nil = nil)

Creates the report. The results are from running the examples in the test suite. The runtime is the total time it took to execute the suite. The remaining_count is the number of tests skipped due to fail-fast. The fail_blank flag indicates whether it is a failure if there were no tests run. The random_seed is the seed used for random number generation.

Source
new(results : Array(Result))

Creates the report. This constructor is intended for reports of subsets of results. The results are from running the examples in the test suite. The runtime is calculated from the results.

Source

Instance methods

each

Yields each result in turn.

Source
error_count

Number of examples that had errors.

Source
errors

Returns a set of results for all errored examples.

Source
example_count

Number of examples.

Source
example_runtime

Length of time it took to run just example code. This does not include hooks, but it does include pre- and post-conditions.

Source
examples_ran

Number of examples run (not skipped or pending).

Source
failed?

Indicates whether the test suite failed.

Source
failed_count

Number of failing examples (includes errors).

Source
failures

Returns a set of results for all failed examples.

Source
overhead_time

Length of time spent in framework processes and hooks.

Source
pending_count

Number of pending examples.

Source
random_seed

Random seed used to determine test ordering.

Source
random_seed?

Random seed used to determine test ordering.

Source
remaining?

Indicates whether there were skipped tests because of a failure causing the test to abort.

Source
remaining_count

Number of remaining tests. This will be greater than zero only in fail-fast mode.

Source
runtime

Total length of time it took to execute the test suite. This includes examples, hooks, and framework processes.

Source
successful_count

Number of passing examples.

Source