Class: RSpec::Core::Formatters::TurnipFormatter

Inherits:
BaseFormatter
  • Object
show all
Defined in:
lib/rspec/core/formatters/turnip_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ TurnipFormatter

Returns a new instance of TurnipFormatter.



14
15
16
17
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 14

def initialize(output)
  super(output)
  @template = ::TurnipFormatter::Template.new
end

Instance Method Details

#dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object



24
25
26
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 24

def dump_summary(duration, example_count, failure_count, pending_count)
  output.puts @template.print_footer(example_count, failure_count, pending_count, duration)
end

#example_failed(example) ⇒ Object



40
41
42
43
44
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 40

def example_failed(example)
  super(example)
  scenario = ::TurnipFormatter::Scenario::Failure.new(example)
  output_scenario(scenario)
end

#example_passed(example) ⇒ Object



28
29
30
31
32
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 28

def example_passed(example)
  super(example)
  scenario = ::TurnipFormatter::Scenario::Pass.new(example)
  output_scenario(scenario)
end

#example_pending(example) ⇒ Object



34
35
36
37
38
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 34

def example_pending(example)
  super(example)
  scenario = ::TurnipFormatter::Scenario::Pending.new(example)
  output_scenario(scenario)
end

#start(example_count) ⇒ Object



19
20
21
22
# File 'lib/rspec/core/formatters/turnip_formatter.rb', line 19

def start(example_count)
  super(example_count)
  output.puts @template.print_header
end