test/test_utils.rb in logging-0.9.1 vs test/test_utils.rb in logging-0.9.2
- old
+ new
@@ -82,9 +82,33 @@
r = str.reduce(0, '##')
assert_equal '##', r
end
+ def test_logger_name
+ assert_equal 'Array', Array.logger_name
+
+ c = Class.new(Array)
+ assert_equal '', c.name
+ assert_equal 'Array', c.logger_name
+
+ meta = class << Array; self; end
+ assert_equal '', meta.name
+ assert_equal 'Array', meta.logger_name
+
+ m = Module.new
+ assert_equal '', m.name
+ assert_equal 'anonymous', m.logger_name
+
+ c = Class.new(::Logging::Logger)
+ assert_equal '', c.name
+ assert_equal 'Logging::Logger', c.logger_name
+
+ meta = class << ::Logging::Logger; self; end
+ assert_equal '', meta.name
+ assert_equal 'Logging::Logger', meta.logger_name
+ end
+
end # class TestUtils
end # module TestLogging
# EOF