module ActiveSupport::LogSubscriber::TestHelper

def set_logger(logger)

end
ActiveRecord::Base.logger = @logger
def logger

Overwrite if you use another logger in your log subscriber.
def set_logger(logger)
  ActiveSupport::LogSubscriber.logger = logger
end

def setup # :nodoc:

:nodoc:
def setup # :nodoc:
  @logger   = MockLogger.new
  @notifier = ActiveSupport::Notifications::Fanout.new
  ActiveSupport::LogSubscriber.colorize_logging = false
  @old_notifier = ActiveSupport::Notifications.notifier
  set_logger(@logger)
  ActiveSupport::Notifications.notifier = @notifier
end

def teardown # :nodoc:

:nodoc:
def teardown # :nodoc:
  set_logger(nil)
  ActiveSupport::Notifications.notifier = @old_notifier
end

def wait

Wait notifications to be published.
def wait
  @notifier.wait
end