many tests

This commit is contained in:
Spencer Alger
2013-12-03 19:01:04 -07:00
parent 2ddde47972
commit 4e5f08a29c
19 changed files with 1011 additions and 201 deletions

View File

@ -0,0 +1,32 @@
/**
* Simple Mock of the http.IncommingMessage. Just implmenents the methods the methods
* we use
*
* @type {[type]}
*/
module.exports = MockIncommingMessage;
var sinon = require('sinon');
var util = require('util');
var Readable = require('stream').Readable;
function MockIncommingMessage() {
var self = this;
Readable.call(self);
self.setEncoding = sinon.stub();
self._read = function () {};
}
util.inherits(MockIncommingMessage, Readable);
/**
* To make the message "talk" do something like this:
*
* process.nextTick(function () {
* if (resp) {
* incom.push(chunk);
* }
* incom.push(null);
* });
*/