diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/run_tests | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/run_tests b/bin/run_tests index 89fbdb24..86a72f26 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -43,6 +43,11 @@ class LeapTest < MiniTest::Unit::TestCase class Pass < MiniTest::Assertion end + def initialize(name) + super(name) + io # << calling this will suppress the marching ants + end + # # Test class dependencies # @@ -69,6 +74,11 @@ class LeapTest < MiniTest::Unit::TestCase assert(false, msg) end + def warn(*msg) + method_name = caller.first.split('`').last.gsub(/(block in |')/,'') + MiniTest::Unit.runner.report_line("WARN", self.class, method_name, nil, msg.join("\n")) + end + # Always runs test methods within a test class in alphanumeric order # def self.test_order @@ -295,16 +305,18 @@ class LeapRunner < MiniTest::Unit output.puts format % [test_count, assertion_count, passes, failures, errors, skips] end - private - # # returns a string for a PASS, SKIP, or FAIL error # def report_line(prefix, klass, meth, e=nil, message=nil) - if e && message + if message indent = "\n " msg_txt = indent + message.split("\n").join(indent) + end + if e && message output.puts "#{prefix}: #{readable(klass.name)} > #{readable(meth)} [#{File.basename(location(e))}]:#{msg_txt}" + elsif message + output.puts "#{prefix}: #{readable(klass.name)} > #{readable(meth)}:#{msg_txt}" else output.puts "#{prefix}: #{readable(klass.name)} > #{readable(meth)}" end @@ -312,6 +324,8 @@ class LeapRunner < MiniTest::Unit sleep(0.0001) # keep lines from being joined together by the logger. output.flush doesn't. end + private + # # Converts snake_case and CamelCase to something more pleasant for humans to read. # |