Sha256: a39aff60c34233451fe47fbd92201ca8c3b5751d01bec078e1a967d8a6c878fc

Contents?: true

Size: 683 Bytes

Versions: 23

Compression:

Stored size: 683 Bytes

Contents

module ActiveSupport
  module Testing
    # Logs a "PostsControllerTest: test name" heading before each test to
    # make test.log easier to search and follow along with.
    module TaggedLogging #:nodoc:
      attr_writer :tagged_logger

      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

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

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
activesupport-5.1.7 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.7.rc1 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.6.2 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.6.1 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.6 lib/active_support/testing/tagged_logging.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/testing/tagged_logging.rb
activesupport-5.1.5 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.5.rc1 lib/active_support/testing/tagged_logging.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/testing/tagged_logging.rb
activesupport-5.1.4 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.4.rc1 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.3 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.3.rc3 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.3.rc2 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.3.rc1 lib/active_support/testing/tagged_logging.rb
tdiary-5.0.5 vendor/bundle/gems/activesupport-5.1.2/lib/active_support/testing/tagged_logging.rb
activesupport-5.1.2 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.2.rc1 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.1 lib/active_support/testing/tagged_logging.rb
activesupport-5.1.0 lib/active_support/testing/tagged_logging.rb