module MiniTest::Unit::Deprecated::HooksCM

def add_setup_hook arg=nil, &block

def add_setup_hook arg=nil, &block
  warn "NOTE: MiniTest::Unit::TestCase.add_setup_hook is deprecated, use before/after_setup via a module (and call super!). It will be removed on 2013-01-01. Called from #{caller.first}"
  hook = arg || block
  @setup_hooks << hook
end

def add_teardown_hook arg=nil, &block

def add_teardown_hook arg=nil, &block
  warn "NOTE: MiniTest::Unit::TestCase#add_teardown_hook is deprecated, use before/after_teardown. It will be removed on 2013-01-01. Called from #{caller.first}"
  hook = arg || block
  @teardown_hooks << hook
end

def setup_hooks # :nodoc:

:nodoc:
def setup_hooks # :nodoc:
  if superclass.respond_to? :setup_hooks then
    superclass.setup_hooks
  else
    []
  end + @setup_hooks
end

def teardown_hooks # :nodoc:

:nodoc:
def teardown_hooks # :nodoc:
  if superclass.respond_to? :teardown_hooks then
    superclass.teardown_hooks
  else
    []
  end + @teardown_hooks
end