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

@ -0,0 +1,23 @@
var sinon = require('sinon');
exports.make = function () {
var log = [];
afterEach(function () {
var stub;
while (stub = log.pop()) {
stub.restore();
}
});
var stubber = function () {
log.push(sinon.stub.apply(sinon, arguments));
};
stubber.autoRelease = function (item) {
if (item.restore && !~log.indexOf(item)) {
log.push(item);
}
};
return stubber;
};