lib/turn/reporter.rb in turn-0.7.0 vs lib/turn/reporter.rb in turn-0.8.0
- old
+ new
@@ -1,7 +1,8 @@
module Turn
require 'turn/colorize'
+ require 'turn/core_ext'
# = Reporter
#
# There are two distinct way in which a report may be utilized
# by a Runner: per-call or per-file. The method #pass, #fail
@@ -21,34 +22,46 @@
@io = io || $stdout
end
# These methods are called in the process of running the tests.
- def start_suite(suite)
+ def start_suite(test_suite)
end
- def start_case(kase)
+ def start_case(test_case)
end
def start_test(test)
end
def pass(message=nil)
end
- def fail(message=nil)
+ def fail(assertion, message=nil)
end
- def error(message=nil)
+ def error(exception, message=nil)
end
def finish_test(test)
end
- def finish_case(kase)
+ def finish_case(test_case)
end
- def finish_suite(suite)
+ def finish_suite(test_suite)
+ end
+
+ private
+
+ # TODO: backtrace filter probably could use some refinement.
+ def filter_backtrace(bt)
+ return [] unless bt
+ bt.reject!{ |line| line.rindex('minitest') }
+ bt.reject!{ |line| line.rindex('test/unit') }
+ bt.reject!{ |line| line.rindex('lib/turn') }
+ bt.reject!{ |line| line.rindex('bin/turn') }
+ bt.map{ |line| line.sub(Dir.pwd+'/', '') }
end
end
end