Class: MultiFormatter

Inherits:
SpinnerFormatter show all
Defined in:
lib/extensions/mspec/mspec/runner/formatters/multi.rb

Constant Summary

Constants inherited from SpinnerFormatter

SpinnerFormatter::HOUR, SpinnerFormatter::MIN, SpinnerFormatter::Spins

Instance Attribute Summary

Attributes inherited from SpinnerFormatter

#length

Attributes inherited from DottedFormatter

#exceptions, #tally, #timer

Instance Method Summary collapse

Methods inherited from SpinnerFormatter

#after, #clear_progress_line, #compute_etr, #compute_percentage, #compute_progress, #exception, #progress_line, #register, #start, #unload

Methods inherited from DottedFormatter

#abort, #after, #before, #exception, #exception?, #failure?, #print, #register

Constructor Details

#initialize(out = nil) ⇒ MultiFormatter

Returns a new instance of MultiFormatter.



5
6
7
8
9
10
# File 'lib/extensions/mspec/mspec/runner/formatters/multi.rb', line 5

def initialize(out=nil)
  super(out)
  @counter = @tally = Tally.new
  @timer = TimerAction.new
  @timer.start
end

Instance Method Details

#aggregate_results(files) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/extensions/mspec/mspec/runner/formatters/multi.rb', line 12

def aggregate_results(files)
  @timer.finish
  @exceptions = []

  files.each do |file|
    d = File.open(file, "r") { |f| YAML.load f }
    File.delete file

    @exceptions += Array(d['exceptions'])
    @tally.files!        d['files']
    @tally.examples!     d['examples']
    @tally.expectations! d['expectations']
    @tally.errors!       d['errors']
    @tally.failures!     d['failures']
  end
end

#finishObject



33
34
35
# File 'lib/extensions/mspec/mspec/runner/formatters/multi.rb', line 33

def finish
  super(false)
end


29
30
31
# File 'lib/extensions/mspec/mspec/runner/formatters/multi.rb', line 29

def print_exception(exc, count)
  print "\n#{count})\n#{exc}\n"
end