Sha256: fe2de01195664e30b6947cb38dbef7eec65b4456724432b91f5fb47dafa7c612
Contents?: true
Size: 1.56 KB
Versions: 3
Compression:
Stored size: 1.56 KB
Contents
require 'test_helper' class TestCLogger < Minitest::Test def setup Prefab::LoggerClient.send(:public, :get_path) Prefab::LoggerClient.send(:public, :level_of) @logger = Prefab::LoggerClient.new($stdout) end def test_get_path assert_equal "test_l.foo_warn", @logger.get_path("/Users/jdwyah/Documents/workspace/RateLimitInc/prefab-cloud-ruby/lib/test_l.rb", "foo_warn") assert_equal "active_support.log_subscriber.info", @logger.get_path("/Users/jdwyah/.rvm/gems/ruby-2.3.3@forcerank/gems/activesupport-4.1.16/lib/active_support/log_subscriber.rb", "info") end def test_level_of assert_equal Logger::INFO, @logger.level_of("app.models.user"), "PREFAB_LOG_CLIENT_BOOTSTRAP_LOG_LEVEL is info" @logger.set_config_client(MockConfigClient.new({})) assert_equal Logger::WARN, @logger.level_of("app.models.user"), "default is warn" @logger.set_config_client(MockConfigClient.new("log_level.app" => "info")) assert_equal Logger::INFO, @logger.level_of("app.models.user") @logger.set_config_client(MockConfigClient.new("log_level.app" => "debug")) assert_equal Logger::DEBUG, @logger.level_of("app.models.user") @logger.set_config_client(MockConfigClient.new("log_level.app" => "debug", "log_level.app.models" => "warn")) assert_equal Logger::WARN, @logger.level_of("app.models.user") end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
prefab-cloud-ruby-0.12.0 | test/test_logger.rb |
prefab-cloud-ruby-0.11.0 | test/test_logger.rb |
prefab-cloud-ruby-0.10.0 | test/test_logger.rb |