Class: RSpec::Formatters::IllustratedJsonFormatter

Inherits:
JsonFormatter
  • Object
show all
Includes:
RSpec::Formatters
Defined in:
lib/rspec/formatters/illustrated_json_formatter.rb

Overview

An extension to the Core::Formatters::JsonFormatter that includes the illustrations for each example.

Instance Method Summary (collapse)

Methods included from RSpec::Formatters

filter, illustrations_of

Instance Method Details

- (Object) format_example(example)

See Also:

  • Core::Formatters::JsonFormatter#format_example


16
17
18
19
20
# File 'lib/rspec/formatters/illustrated_json_formatter.rb', line 16

def format_example(example)
  hash = super
  hash[:illustrations] = example.[:illustrations] || []
  hash
end