Sha256: 68541e57032a00a072a8423066b51934855de77e1272555d23586afc0747749d
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
$LOAD_PATH << sprintf('%s/../', File.dirname(__FILE__)) require 'helper' class TestPostgres < Test::Unit::TestCase def setup # TODO move this to a helper class - or a function that returns one based on .. criteria @good_config = sprintf('%s/../config/log4r-postgres.yaml', File.expand_path(File.dirname(__FILE__))) @table = Time.now.strftime('logs-%Y/%m/%d-%H:%M').to_sym begin require 'pg' rescue LoadError omit('[pg] not installed/configured') end end def teardown; end def test_happy_yaml file = @good_config Log4r::YamlConfigurator.load_yaml_file(file) logger = nil assert_nothing_raised do logger = Log4r::Logger.get('test') end assert_not_nil(logger) assert_equal(0, logger.get_outputter.dbh[@table].count) assert_nothing_raised do logger.debug('this is a debug message') logger.info('this is an info message') logger.warn('this is a warning') logger.error('this is an error') logger.fatal('this is a fatal') end assert_not_equal(0, logger.get_outputter.dbh[@table].count) end def test_happy_hash logger = nil assert_nothing_raised do #logger = Logger::Log4r.new() p 'DBGZ' if nil? end #assert_equal(0, logger.get_outputter.dbh[@table].count) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
log4r-sequel-0.0.3 | test/functional/test_postgres.rb |