Class: MiniTest::Unit
Overview
:nodoc:
Instance Method Summary collapse
-
#assertion_count ⇒ Integer
MiniTest tracks assertion counts internally in it’s Unit class via the
assertion_count
attribute. -
#puke(k, m, e) ⇒ String
To teach MiniTest to recognize AE’s expanded concept of assertions we add in an extra capture clause to it’s #puke method.
Instance Method Details
#assertion_count ⇒ Integer
MiniTest tracks assertion counts internally in it’s Unit class via the assertion_count
attribute. To work with AE we need add in AE’s assertion total by overriding the assertion_count
method.
13 14 15 |
# File 'lib/ae/adapters/minitest.rb', line 13 def assertion_count @assertion_count + AE::Assertor.counts[:total] end |
#puke(k, m, e) ⇒ String
To teach MiniTest to recognize AE’s expanded concept of assertions we add in an extra capture clause to it’s #puke method.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ae/adapters/minitest.rb', line 21 def puke k, m, e case e when MiniTest::Skip @skips += 1 return "S" unless @verbose e = "Skipped:\n#{m}(#{k}) [#{location e}]:\n#{e.}\n" when MiniTest::Assertion @failures += 1 e = "Failure:\n#{m}(#{k}) [#{location e}]:\n#{e.}\n" else if e.respond_to?(:assertion?) && e.assertion? @failures += 1 e = "Failure:\n#{m}(#{c}) [#{location e}]:\n#{e.}\n" else @errors += 1 b = MiniTest::filter_backtrace(e.backtrace).join "\n " e = "Error:\n#{m}(#{k}):\n#{e.class}: #{e.}\n #{b}\n" end end @report << e e[0, 1] end |