class Test::Reporters::Tap

Classic TAP Reporter

This reporter conforms to v12 of TAP. It could do with some imporvements yet, and eventually upgraded to v13 of standard.

Public Instance Methods

begin_suite(suite) click to toggle source
# File lib/rubytest/format/tap.rb, line 12
def begin_suite(suite)
  @start_time = Time.now
  @i = 0
  @n = total_count(suite)
  puts "1..#{@n}"
end
begin_test(test) click to toggle source
# File lib/rubytest/format/tap.rb, line 19
def begin_test(test)
  @i += 1
end
error(test, exception) click to toggle source
# File lib/rubytest/format/tap.rb, line 37
def error(test, exception)
  puts "not ok #{@i} - #{test}"
  puts "  ERROR #{exception.class}"
  puts "  #{exception}"
  puts "  " + clean_backtrace(exception).join("\n        ")
end
fail(test, exception) click to toggle source
# File lib/rubytest/format/tap.rb, line 29
def fail(test, exception)
  puts "not ok #{@i} - #{test}"
  puts "  FAIL #{exception.class}"
  puts "  #{exception}"
  puts "  #{clean_backtrace(exception)[0]}"
end
omit(test, exception) click to toggle source
# File lib/rubytest/format/tap.rb, line 52
def omit(test, exception)
  puts "ok #{@i} - #{test}"
  puts "  OMIT"
  puts "  #{clean_backtrace(exception)[1]}"
end
pass(test) click to toggle source
# File lib/rubytest/format/tap.rb, line 24
def pass(test)
  puts "ok #{@i} - #{test}"
end
todo(test, exception) click to toggle source
# File lib/rubytest/format/tap.rb, line 45
def todo(test, exception)
  puts "not ok #{@i} - #{test}"
  puts "  PENDING"
  puts "  #{clean_backtrace(exception)[1]}"
end