class Minitest::Reporters::BaseReporter

Attributes

tests[RW]

Public Class Methods

new(options={}) click to toggle source
Calls superclass method
# File lib/minitest/reporters/base_reporter.rb, line 6
def initialize(options={})
  super($stdout, options)
  self.tests = []
end

Public Instance Methods

add_defaults(defaults) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 11
def add_defaults(defaults)
  self.options = defaults.merge(options)
end
after_test(test) click to toggle source

called by our own after hooks

# File lib/minitest/reporters/base_reporter.rb, line 30
def after_test(test)
end
before_test(test) click to toggle source

called by our own before hooks

# File lib/minitest/reporters/base_reporter.rb, line 16
def before_test(test)
  last_test = tests.last
  if last_test.class != test.class
    after_suite(last_test.class) if last_test
    before_suite(test.class)
  end
end
record(test) click to toggle source
Calls superclass method
# File lib/minitest/reporters/base_reporter.rb, line 24
def record(test)
  super
  tests << test
end
report() click to toggle source
Calls superclass method
# File lib/minitest/reporters/base_reporter.rb, line 33
def report
  super
  after_suite(tests.last.class)
end

Protected Instance Methods

after_suite(test) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 40
def after_suite(test)
end
before_suite(test) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 43
def before_suite(test)
end
filter_backtrace(backtrace) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 76
def filter_backtrace(backtrace)
  Minitest.filter_backtrace(backtrace)
end
print(*args) click to toggle source
print_colored_status(test) click to toggle source
print_info(e, name=true) click to toggle source
puts(*args) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 80
def puts(*args)
  io.puts(*args)
end
result(test) click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 46
def result(test)
  if test.error?
    :error
  elsif test.skipped?
    :skip
  elsif test.failure
    :fail
  else
    :pass
  end
end
total_count() click to toggle source
# File lib/minitest/reporters/base_reporter.rb, line 72
def total_count
  options[:total_count]
end
total_time() click to toggle source
Calls superclass method
# File lib/minitest/reporters/base_reporter.rb, line 68
def total_time
  super || Minitest::Reporters.clock_time - start_time
end