class Spectator::Formatting::JsonFormatter

Overview

Produces a JSON document containing the test results.

Defined in:

spectator/formatting/json_formatter.cr

Constructors

Instance Method Summary

Instance methods inherited from class Spectator::Formatting::Formatter

end_example(result : Result) end_example, end_suite(report : Report, profile : Profile | Nil) end_suite, start_example(example : Example) start_example, start_suite(suite : TestSuite) start_suite

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(io : IO = STDOUT) #

Creates the formatter. By default, output is sent to STDOUT.


[View source]

Instance Method Detail

def end_example(result : Result) #

Called when a test finishes. The result of the test is provided.


[View source]
def end_suite(report : Report, profile : Profile | Nil) #

Called when a test suite finishes. The results from the entire suite are provided. The profile value is not nil when profiling results should be displayed.


[View source]
def start_example(example : Example) #

Called before a test starts.


[View source]
def start_suite(suite : TestSuite) #

Called when a test suite is starting to execute.


[View source]