Sha256: 0ea923a1c4f16d233f79f601417268acd72c1e033bc763e43ea4d8935f7d8ef1
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
# $Id$ require File.join(File.dirname(__FILE__), %w[.. setup]) module TestLogging module TestLayouts class TestBasic < Test::Unit::TestCase include LoggingTestCase def setup super ::Logging.init @layout = ::Logging::Layouts::Basic.new @levels = ::Logging::LEVELS end def test_format event = ::Logging::LogEvent.new( 'ArrayLogger', @levels['info'], 'log message', false) assert_equal " INFO ArrayLogger : log message\n", @layout.format(event) event.data = [1, 2, 3, 4] assert_equal(" INFO ArrayLogger : <Array> #{[1,2,3,4]}\n", @layout.format(event)) event.level = @levels['debug'] event.data = 'and another message' log = "DEBUG ArrayLogger : and another message\n" assert_equal log, @layout.format(event) event.logger = 'Test' event.level = @levels['fatal'] event.data = Exception.new log = "FATAL Test : <Exception> Exception\n" assert_equal log, @layout.format(event) end end # class TestBasic end # module TestLayouts end # module TestLogging # EOF
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
filterfish-logging-0.9.8 | test/layouts/test_basic.rb |
logging-0.8.0 | test/layouts/test_basic.rb |