summaryrefslogtreecommitdiff
path: root/spec/mspec/lib/mspec/runner/formatters/unit.rb
blob: 69b68dc0d5a36dfa15a64eddc9816fbe869af5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'mspec/expectations/expectations'
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