Sha256: 30f33d68245ed3b67a1efbe726080bb4157e48337233bf8a87f3d2a75b6b5d72

Contents?: true

Size: 1.21 KB

Versions: 24

Compression:

Stored size: 1.21 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_nil logger.instance_variable_get(:@logdev).instance_variable_get(:@filename)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
roku_builder-4.30.0 test/roku_builder/test_logger.rb
roku_builder-4.29.9 test/roku_builder/test_logger.rb
roku_builder-4.29.8 test/roku_builder/test_logger.rb
roku_builder-4.29.7 test/roku_builder/test_logger.rb
roku_builder-4.29.6 test/roku_builder/test_logger.rb
roku_builder-4.29.4 test/roku_builder/test_logger.rb
roku_builder-4.29.2 test/roku_builder/test_logger.rb
roku_builder-4.29.1 test/roku_builder/test_logger.rb
roku_builder-4.28.0 test/roku_builder/test_logger.rb
roku_builder-4.27.2 test/roku_builder/test_logger.rb
roku_builder-4.27.1 test/roku_builder/test_logger.rb
roku_builder-4.27.0 test/roku_builder/test_logger.rb
roku_builder-4.26.2 test/roku_builder/test_logger.rb
roku_builder-4.26.1 test/roku_builder/test_logger.rb
roku_builder-4.26.0 test/roku_builder/test_logger.rb
roku_builder-4.25.6 test/roku_builder/test_logger.rb
roku_builder-4.25.5 test/roku_builder/test_logger.rb
roku_builder-4.25.4 test/roku_builder/test_logger.rb
roku_builder-4.25.3 test/roku_builder/test_logger.rb
roku_builder-4.25.1 test/roku_builder/test_logger.rb