module ActiveSupport::Testing::SetupAndTeardown

def self.prepended(klass)

def self.prepended(klass)
  klass.include ActiveSupport::Callbacks
  klass.define_callbacks :setup, :teardown
  klass.extend ClassMethods
end

def after_teardown # :nodoc:

:nodoc:
def after_teardown # :nodoc:
  begin
    run_callbacks :teardown
  rescue => e
    self.failures << Minitest::UnexpectedError.new(e)
  end
  super
end

def before_setup # :nodoc:

:nodoc:
def before_setup # :nodoc:
  super
  run_callbacks :setup
end