Sha256: bd26bfff1fb4e5f3a838081f7b7aa31fe4fdda26f49ce0e31d107ed1613eddf1
Contents?: true
Size: 1.63 KB
Versions: 1
Compression:
Stored size: 1.63 KB
Contents
# $Id: test_log_event.rb 9 2007-01-11 23:51:41Z tim_pease $ require 'test/setup.rb' module TestLogging class TestEvent < Test::Unit::TestCase include LoggingTestCase def setup super @appender = EventAppender.new('test') @logger = ::Logging::Logger['TestLogger'] @logger.add @appender @logger.info 'message 1', %w(a b c) @event = @appender.event end def test_data assert_equal ['message 1', %w(a b c)], @event.data end def test_data_eq @event.data = ['message 2'] assert_equal ['message 2'], @event.data end def test_file assert_equal '', @event.file @logger.trace = true @logger.warn 'warning message' assert_match %r/test_log_event.rb\z/, @appender.event.file end def test_level assert_equal 1, @event.level end def test_level_eq @event.level = 3 assert_equal 3, @event.level end def test_line assert_equal '', @event.file @logger.trace = true @logger.error 'error message' assert_match %r/\d+/, @appender.event.line end def test_logger assert_equal 'TestLogger', @event.logger end def test_logger_eq @event.logger = 'MyLogger' assert_equal 'MyLogger', @event.logger end def test_method assert_equal '', @event.file @logger.trace = true @logger.debug 'debug message' assert_equal 'test_method', @appender.event.method end end # class TestLogger class EventAppender < ::Logging::Appender attr_reader :event def append( event ) @event = event end end end # module TestLogging # EOF
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
logging-0.1.0 | test/test_log_event.rb |