changes for node 0.1.30, tests run but don't pass yet

This commit is contained in:
csausdev
2010-02-22 20:09:56 +11:00
parent 15e9a30d05
commit f130b95b08
3 changed files with 14 additions and 30 deletions

View File

@@ -1,12 +1,12 @@
posix = require('posix');
fs = require('fs'), events = require('events');
waitForWriteAndThenRead = function (filename) {
//here's the tricky part - writes are asynchronous
//so I'm going to make a promise, wait a bit and then
//try to read the file.
var content, promise = new process.Promise();
var content, promise = new events.Promise();
promise.addCallback(function() {
content = posix.cat(filename).timeout(500).wait();
content = posix.readFileSync(filename);
});
setTimeout(function() {
promise.emitSuccess();
@@ -185,12 +185,12 @@ describe 'log4js'
before_each
log4js.clearAppenders();
try {
posix.unlink('./tmp-tests.log').wait();
posix.unlinkSync('./tmp-tests.log');
} catch(e) {
print('Could not delete tmp-tests.log: '+e.message);
}
try {
posix.unlink('./tmp-tests-warnings.log').wait();
posix.unlinkSync('./tmp-tests-warnings.log');
} catch (e) {
print('Could not delete tmp-tests-warnings.log: '+e.message);
}