123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::Testing::TaggedLogging

Do not use. This module is for internal use only.

Overview

Logs a “PostsControllerTest: test name” heading before each test to make test.log easier to search and follow along with.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#tagged_logger (rw, private)

[ GitHub ]

  
# File 'activesupport/lib/active_support/testing/tagged_logging.rb', line 22

def tagged_logger
  @tagged_logger ||= (defined?(Rails.logger) && Rails.logger)
end

#tagged_logger=(value) (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/testing/tagged_logging.rb', line 8

attr_writer :tagged_logger

Instance Method Details

#before_setup

[ GitHub ]

  
# File 'activesupport/lib/active_support/testing/tagged_logging.rb', line 10

def before_setup
  if tagged_logger && tagged_logger.info?
    heading = "#{self.class}: #{name}"
    divider = "-" * heading.size
    tagged_logger.info divider
    tagged_logger.info heading
    tagged_logger.info divider
  end
  super
end