Class: MiniTest::Unit

Inherits:
Object
  • Object
show all
Defined in:
lib/brass/adapters/minitest.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#puke(c, m, x) ⇒ Object

To teach MiniTest to recognize the expanded concept of assertions we add in an extra capture clause to the it’s #puke method.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/brass/adapters/minitest.rb', line 5

def puke c, m, x
  case x
  when MiniTest::Skip
    @skips = @skips + 1
    x = "Skipped:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
  when MiniTest::Assertion
    @failures = @failures + 1
    x = "Failure:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
  when x.respond_to?(:assertion?) && x.assertion?
    @failures = @failures + 1
    x = "Failure:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
  else
    @errors = @errors + 1
    b = MiniTest::filter_backtrace(x.backtrace).join("\n    ")
    x = "Error:\n#{m}(#{c}):\n#{x.class}: #{x.message}\n    #{b}\n"
  end
  @report << x
  x[0, 1]
end