more tests, simplified the standard tests for the loggers

This commit is contained in:
Spencer Alger
2013-12-04 12:49:39 -07:00
parent 4e5f08a29c
commit c070c9e741
30 changed files with 535 additions and 505 deletions

View File

@ -2,7 +2,7 @@
* Simple Mock of the http.IncommingMessage. Just implmenents the methods the methods
* we use
*
* @type {[type]}
* @type {Constuctor}
*/
module.exports = MockIncommingMessage;

View File

@ -0,0 +1,22 @@
/**
* Just a buffer really, but one that implements just a few methods similar
* to the old writable streams, but without the same internals as streams 2.0
* Writables.
*
* @type {Constuctor}
*/
module.exports = MockOldWritableStream;
var util = require('util');
function MockOldWritableStream(opts) {
var queue = [];
this.write = function (chunk) {
queue.push(chunk);
};
this.end = function () {
queue.push(null);
};
}

View File

@ -1,3 +1,8 @@
/**
* Extended version of http.ClientRequest with a few methods stubbed
*
* @type {Constructor}
*/
module.exports = MockRequest;
var sinon = require('sinon');

View File

@ -1,6 +1,6 @@
/**
* Just a buffer really, but one that implements the Writeable class
* @type {WritableStream}
* @type {Constuctor}
*/
module.exports = MockWritableStream;
@ -10,9 +10,7 @@ var util = require('util');
function MockWritableStream(opts) {
Writable.call(this, opts);
this._write = function (chunk, encoding, cb) {
};
this._write = function (chunk, encoding, cb) {};
}
util.inherits(MockWritableStream, Writable);