Update dateFile EOL usage to be consistent with appender.

From the looks of the Travis CI failure, this could be the issue
causing failures. Not sure as I can't reproduce locally. However,
it is still an inconsistency and worth fixing.
This commit is contained in:
John Engler 2014-04-08 10:47:18 -07:00
parent 633ed3cddb
commit 3b5eb28115

View File

@ -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();