0.8 compatibility

This commit is contained in:
osher 2014-11-05 11:58:09 +02:00
parent 9da158f945
commit 2f44dbf53e
2 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,7 @@ function MockRequest(remoteAddr, method, originalUrl, headers) {
function MockResponse() {
var r = this;
this.end = function(chunk, encoding) {
setImmediate(function(){ r.emit('finish') });
r.emit('finish');
};
this.writeHead = function(code, headers) {

View File

@ -37,7 +37,7 @@ function MockResponse(statusCode) {
this.statusCode = statusCode;
this.end = function(chunk, encoding) {
setImmediate(function(){ r.emit('finish') });
r.emit('finish');
};
}
util.inherits(MockResponse, EE);
@ -87,9 +87,12 @@ vows.describe('log4js connect logger').addBatch({
topic: function(d) {
var req = new MockRequest('my.remote.addr', 'GET', 'http://url/hoge.gif'); // gif
var res = new MockResponse(200);
var cb = this.callback;
d.cl(req, res, function() { });
res.end('chunk', 'encoding');
return d.ml.messages;
setTimeout(function() {
cb(null, d.ml.messages);
},10);
},
'check message': function(messages) {
assert.isArray(messages);