Fixed tests to work with node-v0.1.102

This commit is contained in:
Gareth Jones
2010-08-11 13:36:51 +10:00
committed by Gareth
parent 2fe9b0b6bd
commit 8d542f1aa6
2 changed files with 21 additions and 14 deletions

View File

@@ -1,11 +1,15 @@
fs = require('fs'), events = require('events');
waitForWriteAndThenReadFile = function (filename) {
process.loop();
return fs.readFileSync(filename);
};
describe 'log4js'
before
extend(context, {
log4js : require("log4js"),
fs: require("fs"),
waitForWriteAndThenReadFile : function (filename) {
process.loop();
return fs.readFileSync(filename, "utf8");
}
});
end
before_each
log4js.clearAppenders();
event = '';
@@ -132,7 +136,7 @@ describe 'log4js'
try {
fs.unlinkSync('./tmp-tests.log');
} catch(e) {
print('Could not delete tmp-tests.log: '+e.message);
//print('Could not delete tmp-tests.log: '+e.message);
}
end
@@ -171,12 +175,12 @@ describe 'log4js'
try {
fs.unlinkSync('./tmp-tests.log');
} catch(e) {
print('Could not delete tmp-tests.log: '+e.message);
//print('Could not delete tmp-tests.log: '+e.message);
}
try {
fs.unlinkSync('./tmp-tests-warnings.log');
} catch (e) {
print('Could not delete tmp-tests-warnings.log: '+e.message);
//print('Could not delete tmp-tests-warnings.log: '+e.message);
}
end
@@ -207,9 +211,14 @@ describe 'log4js'
waitForWriteAndThenReadFile('./tmp-tests-warnings.log').should.be 'both\nboth\n'
end
end
end
describe 'Date'
before
require("log4js");
end
describe 'toFormattedString'
it 'should add a toFormattedString method to Date'
var date = new Date();