@ -4,7 +4,8 @@ var vows = require('vows')
, path = require ( 'path' )
, path = require ( 'path' )
, fs = require ( 'fs' )
, fs = require ( 'fs' )
, sandbox = require ( 'sandboxed-module' )
, sandbox = require ( 'sandboxed-module' )
, log4js = require ( '../lib/log4js' ) ;
, log4js = require ( '../lib/log4js' )
, EOL = require ( 'os' ) . EOL || '\n' ;
function removeFile ( filename ) {
function removeFile ( filename ) {
return function ( ) {
return function ( ) {
@ -134,7 +135,7 @@ vows.describe('../lib/appenders/dateFile').addBatch({
teardown : removeFile ( 'date-file-test.log' ) ,
teardown : removeFile ( 'date-file-test.log' ) ,
'should load appender configuration from a json file' : function ( err , contents ) {
'should load appender configuration from a json file' : function ( err , contents ) {
assert . include ( contents , 'this should be written to the file' + require( 'os' ) . EOL) ;
assert . include ( contents , 'this should be written to the file' + EOL) ;
assert . equal ( contents . indexOf ( 'this should not be written to the file' ) , - 1 ) ;
assert . equal ( contents . indexOf ( 'this should not be written to the file' ) , - 1 ) ;
}
}
} ,
} ,
@ -161,7 +162,7 @@ vows.describe('../lib/appenders/dateFile').addBatch({
, thisTime = format . asString ( options . appenders [ 0 ] . pattern , new Date ( ) ) ;
, thisTime = format . asString ( options . appenders [ 0 ] . pattern , new Date ( ) ) ;
fs . writeFileSync (
fs . writeFileSync (
path . join ( _ _dirname , 'date-file-test' + thisTime ) ,
path . join ( _ _dirname , 'date-file-test' + thisTime ) ,
"this is existing data" + require( 'os' ) . EOL,
"this is existing data" + EOL,
'utf8'
'utf8'
) ;
) ;
log4js . clearAppenders ( ) ;
log4js . clearAppenders ( ) ;