module Minitest::Reporters

def run_with_hooks(*args)

def run_with_hooks(*args)
  if defined?(Minitest::Reporters) && (reporters = Minitest::Reporters.reporters)
    reporters.each { |r| r.before_test(self) }
    result = run_without_hooks(*args)
    reporters.each { |r| r.after_test(self) }
    result
  else
    run_without_hooks(*args)
  end
end