class Spectator::Report

Overview

Outcome of all tests in a suite.

Included Modules

Defined in:

spectator/report.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

should(matcher) should, should_eventually(matcher) should_eventually, should_never(matcher) should_never, should_not(matcher) should_not

Constructor Detail

def self.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.


[View source]
def self.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.


[View source]

Instance Method Detail

def each(&) #

Yields each result in turn.


[View source]
def error_count : Int32 #

Number of examples that had errors.


[View source]
def errors #

Returns a set of results for all errored examples.


[View source]
def example_count #

Number of examples.


[View source]
def 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.


[View source]
def examples_ran #

Number of examples run (not skipped or pending).


[View source]
def failed? #

Indicates whether the test suite failed.


[View source]
def failed_count : Int32 #

Number of failing examples (includes errors).


[View source]
def failures #

Returns a set of results for all failed examples.


[View source]
def overhead_time #

Length of time spent in framework processes and hooks.


[View source]
def pending_count : Int32 #

Number of pending examples.


[View source]
def random_seed : UInt64 | Nil #

Random seed used to determine test ordering.


[View source]
def random_seed? : UInt64 | Nil | Nil #

Random seed used to determine test ordering.


[View source]
def remaining? #

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


[View source]
def remaining_count : Int32 #

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


[View source]
def runtime : Time::Span #

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


[View source]
def successful_count : Int32 #

Number of passing examples.


[View source]