Class: Micronaut::Formatters::ProgressFormatter

Inherits:
BaseTextFormatter show all
Defined in:
lib/micronaut/formatters/progress_formatter.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#behaviour, #duration, #example_count, #examples

Instance Method Summary collapse

Methods inherited from BaseTextFormatter

#close, #colorise, #dump_failures, #dump_pending, #dump_summary, #format_caller

Methods inherited from BaseFormatter

#add_behaviour, #close, #color_enabled?, #configuration, #dump_failures, #dump_pending, #dump_summary, #failed_examples, #format_backtrace, #initialize, #output, #pending_examples, #profile_examples?, #start, #trace, #trace_override_flag

Constructor Details

This class inherits a constructor from Micronaut::Formatters::BaseFormatter

Instance Method Details

#example_finished(example) ⇒ Object



16
17
18
19
# File 'lib/micronaut/formatters/progress_formatter.rb', line 16

def example_finished(example)
  super
  output.print output_for(example)
end

#output_for(example) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/micronaut/formatters/progress_formatter.rb', line 6

def output_for(example)
  case example.execution_result[:status]
  when 'failed' then colorise('F', example.execution_result[:exception_encountered])
  when 'pending' then yellow('*')
  when 'passed' then green('.')
  else
    red(example.execution_result[:status])
  end
end

#start_dump(duration) ⇒ Object



21
22
23
24
25
# File 'lib/micronaut/formatters/progress_formatter.rb', line 21

def start_dump(duration)
  super
  output.puts
  output.flush
end