class MiniTest::Unit::TestCase

def run runner

def run runner
  trap "INFO" do
    runner.report.each_with_index do |msg, i|
      warn "\n%3d) %s" % [i + 1, msg]
    end
    warn ''
    time = runner.start_time ? Time.now - runner.start_time : 0
    warn "Current Test: %s#%s %.2fs" % [self.class, self.__name__, time]
    runner.status $stderr
  end if SUPPORTS_INFO_SIGNAL
  start_time = Time.now
  result = ""
  begin
    @passed = nil
    self.before_setup
    self.setup
    self.after_setup
    self.run_test self.__name__
    result = "." unless io?
    time = Time.now - start_time
    runner.record self.class, self.__name__, self._assertions, time, nil
    @passed = true
  rescue *PASSTHROUGH_EXCEPTIONS
    raise
  rescue Exception => e
    @passed = Skip === e
    time = Time.now - start_time
    runner.record self.class, self.__name__, self._assertions, time, e
    result = runner.puke self.class, self.__name__, e
  ensure
    %w{ before_teardown teardown after_teardown }.each do |hook|
      begin
        self.send hook
      rescue *PASSTHROUGH_EXCEPTIONS
        raise
      rescue Exception => e
        @passed = false
        runner.record self.class, self.__name__, self._assertions, time, e
        result = runner.puke self.class, self.__name__, e
      end
    end
    trap 'INFO', 'DEFAULT' if SUPPORTS_INFO_SIGNAL
  end
  result
end