Sha256: f5700af3c84a46a0a206632c4e6dbfd3bc83662888f5ce3af109f9dc102d2f9b

Contents?: true

Size: 714 Bytes

Versions: 141

Compression:

Stored size: 714 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

141 entries across 132 versions & 16 rubygems

Version Path
activesupport-6.1.7.10 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.9 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.8 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.7 lib/active_support/testing/tagged_logging.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.6 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.5 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.4 lib/active_support/testing/tagged_logging.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/testing/tagged_logging.rb
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/testing/tagged_logging.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.3 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.2 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7.1 lib/active_support/testing/tagged_logging.rb
activesupport-6.0.6.1 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.7 lib/active_support/testing/tagged_logging.rb
activesupport-6.0.6 lib/active_support/testing/tagged_logging.rb
activesupport-6.1.6.1 lib/active_support/testing/tagged_logging.rb
activesupport-6.0.5.1 lib/active_support/testing/tagged_logging.rb
activesupport-5.2.8.1 lib/active_support/testing/tagged_logging.rb