Sha256: 509bb6f3c8ca45f1e0b44ac0a6a32e1ad13ae6e56a05c8e543df3ff74865cec1

Contents?: true

Size: 1.22 KB

Versions: 71

Compression:

Stored size: 1.22 KB

Contents

# ********** Copyright Viacom, Inc. Apache 2.0 **********

require_relative "test_helper.rb"

module RokuBuilder
  class LoggerTest < Minitest::Test

    def test_logger
      Logger.class_variable_set(:@@instance, nil)
      logger_a = Logger.instance
      logger_b = Logger.instance
      assert_equal logger_a, logger_b
    end

    def test_set_debug
      logger = Minitest::Mock.new
      Logger.class_variable_set(:@@instance, logger)
      logger.expect(:level=, nil, [::Logger::DEBUG])
      Logger.set_debug
      logger.verify
      Logger.set_testing
    end

    def test_set_info
      logger = Minitest::Mock.new
      Logger.class_variable_set(:@@instance, logger)
      logger.expect(:level=, nil, [::Logger::INFO])
      Logger.set_info
      logger.verify
      Logger.set_testing
    end

    def test_set_warn
      logger = Minitest::Mock.new
      Logger.class_variable_set(:@@instance, logger)
      logger.expect(:level=, nil, [::Logger::WARN])
      Logger.set_warn
      logger.verify
      Logger.set_testing
    end

    def test_logger_testing
      Logger.set_testing
      logger = Logger.instance
      assert_equal "/dev/null", logger.instance_variable_get(:@logdev).instance_variable_get(:@filename)
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
roku_builder-4.23.2 test/roku_builder/test_logger.rb
roku_builder-4.23.1 test/roku_builder/test_logger.rb
roku_builder-4.23.0 test/roku_builder/test_logger.rb
roku_builder-4.22.9 test/roku_builder/test_logger.rb
roku_builder-4.22.8 test/roku_builder/test_logger.rb
roku_builder-4.22.7 test/roku_builder/test_logger.rb
roku_builder-4.22.6 test/roku_builder/test_logger.rb
roku_builder-4.22.5 test/roku_builder/test_logger.rb
roku_builder-4.22.4 test/roku_builder/test_logger.rb
roku_builder-4.22.3 test/roku_builder/test_logger.rb
roku_builder-4.22.2 test/roku_builder/test_logger.rb
roku_builder-4.22.1 test/roku_builder/test_logger.rb
roku_builder-4.21.6 test/roku_builder/test_logger.rb
roku_builder-4.21.5 test/roku_builder/test_logger.rb
roku_builder-4.21.4 test/roku_builder/test_logger.rb
roku_builder-4.21.3 test/roku_builder/test_logger.rb
roku_builder-4.21.2 test/roku_builder/test_logger.rb
roku_builder-4.21.1 test/roku_builder/test_logger.rb
roku_builder-4.21.0 test/roku_builder/test_logger.rb
roku_builder-4.20.0 test/roku_builder/test_logger.rb