aboutsummaryrefslogtreecommitdiffstats
path: root/spec/mspec/lib/mspec/runner/formatters/unit.rb
blob: d03ae79e9fd2d5908a6d511266be2861b6716d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'mspec/runner/formatters/dotted'

class UnitdiffFormatter < DottedFormatter
  def finish
    print "\n\n#{@timer.format}\n"
    count = 0
    @exceptions.each do |exc|
      outcome = exc.failure? ? "FAILED" : "ERROR"
      print "\n#{count += 1})\n#{exc.description} #{outcome}\n"
      print exc.message, ":\n"
      print exc.backtrace, "\n"
    end
    print "\n#{@tally.format}\n"
  end

  def backtrace(exc)
    exc.backtrace && exc.backtrace.join("\n")
  end
  private :backtrace
end