Sha256: 4256cb1b6c496d10dbe7a710329df399203be92086542f9af958ab6f56cade56

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module ActiveModelSerializers
  class LoggerTest < ActiveSupport::TestCase
    def test_logger_is_set_to_action_controller_logger_when_initializer_runs
      assert_equal $action_controller_logger, ActionController::Base.logger # rubocop:disable Style/GlobalVars
    end

    def test_logger_can_be_set
      original_logger = ActiveModelSerializers.logger
      logger = Logger.new(STDOUT)

      ActiveModelSerializers.logger = logger

      assert_equal ActiveModelSerializers.logger, logger
    ensure
      ActiveModelSerializers.logger = original_logger
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
active_model_serializers_custom-0.10.90 test/logger_test.rb
active_model_serializers-0.10.9 test/logger_test.rb