Sha256: a75be276442ffd84ec1c7ed9b8a08d7dcd205b019205cf2192d38a214f1b4ce1

Contents?: true

Size: 715 Bytes

Versions: 84

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

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

84 entries across 80 versions & 11 rubygems

Version Path
activesupport-7.2.1 lib/active_support/testing/tagged_logging.rb
activesupport-7.2.0 lib/active_support/testing/tagged_logging.rb
activesupport-7.2.0.rc1 lib/active_support/testing/tagged_logging.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.4/lib/active_support/testing/tagged_logging.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/testing/tagged_logging.rb
activesupport-7.2.0.beta3 lib/active_support/testing/tagged_logging.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/testing/tagged_logging.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/testing/tagged_logging.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/testing/tagged_logging.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/testing/tagged_logging.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/testing/tagged_logging.rb
activesupport-7.2.0.beta2 lib/active_support/testing/tagged_logging.rb
activesupport-7.1.3.4 lib/active_support/testing/tagged_logging.rb
activesupport-7.0.8.4 lib/active_support/testing/tagged_logging.rb
activesupport-7.2.0.beta1 lib/active_support/testing/tagged_logging.rb
activesupport-7.1.3.2 lib/active_support/testing/tagged_logging.rb
activesupport-7.1.3.1 lib/active_support/testing/tagged_logging.rb
activesupport-7.0.8.1 lib/active_support/testing/tagged_logging.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3/lib/active_support/testing/tagged_logging.rb
activesupport-7.1.3 lib/active_support/testing/tagged_logging.rb