class Tapout::Reporters::TapReporter

Tap Reporter

Public Instance Methods

error(entry) click to toggle source
Calls superclass method Tapout::Reporters::Abstract#error
# File lib/tapout/reporters/tap_reporter.rb, line 57
def error(entry)
  super(entry)

  @i += 1
  x = entry['exception']

  #desc = ok.concern.label + " #{ok.arguments.inspect}"

  body = []
  body << "ERROR #{x['file']}:#{x['line']}" #clean_backtrace(exception.backtrace)[0..2].join("    \n")
  body << "#{x['class']}: #{x['message']}"
  #body << "#{x['message']}"
  body << ""
  body << code_snippet(entry)
  body << ""
  body = body.join("\n").gsub(/^/, '  # ')

  puts "not ok #{@i} - #{entry['label']}"
  puts body
end
fail(entry) click to toggle source
Calls superclass method Tapout::Reporters::Abstract#fail
# File lib/tapout/reporters/tap_reporter.rb, line 38
def fail(entry)
  super(entry)

  @i += 1
  x = entry['exception']

  #desc = #ok.concern.label + " #{ok.arguments.inspect}"

  body = []
  body << "FAIL #{x['file']}:#{x['line']}" #clean_backtrace(exception.backtrace)[0]
  body << "#{x['message']}"
  body << code_snippet(entry)
  body = body.join("\n").gsub(/^/, '  # ')

  puts "not ok #{@i} - #{entry['label']}"
  puts body
end
pass(entry) click to toggle source
Calls superclass method Tapout::Reporters::Abstract#pass
# File lib/tapout/reporters/tap_reporter.rb, line 28
def pass(entry)
  super(entry)

  @i += 1
  #desc = entry['message'] #+ " #{ok.arguments.inspect}"

  puts "ok #{@i} - #{entry['label']}"
end
start_case(entry) click to toggle source
# File lib/tapout/reporters/tap_reporter.rb, line 18
def start_case(entry)
  #$stdout.puts concern.label.ansi(:bold)
end
start_suite(entry) click to toggle source
# File lib/tapout/reporters/tap_reporter.rb, line 9
def start_suite(entry)
  @start = Time.now
  @i = 0
  #n = 0
  #suite.concerns.each{ |f| f.concerns.each { |s| n += s.ok.size } }
  puts "1..#{entry['count']}"
end