From 3b5eb28115606cbcc3199f678ef45c64ae4d9ed9 Mon Sep 17 00:00:00 2001 From: John Engler Date: Tue, 8 Apr 2014 10:47:18 -0700 Subject: [PATCH] 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. --- test/dateFileAppender-test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/dateFileAppender-test.js b/test/dateFileAppender-test.js index 59355e2..3c61c70 100644 --- a/test/dateFileAppender-test.js +++ b/test/dateFileAppender-test.js @@ -4,7 +4,8 @@ var vows = require('vows') , path = require('path') , fs = require('fs') , sandbox = require('sandboxed-module') -, log4js = require('../lib/log4js'); +, log4js = require('../lib/log4js') +, EOL = require('os').EOL || '\n'; function removeFile(filename) { return function() { @@ -134,7 +135,7 @@ vows.describe('../lib/appenders/dateFile').addBatch({ teardown: removeFile('date-file-test.log'), '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); } }, @@ -161,7 +162,7 @@ vows.describe('../lib/appenders/dateFile').addBatch({ , thisTime = format.asString(options.appenders[0].pattern, new Date()); fs.writeFileSync( path.join(__dirname, 'date-file-test' + thisTime), - "this is existing data" + require('os').EOL, + "this is existing data" + EOL, 'utf8' ); log4js.clearAppenders();