more tests, simplified the standard tests for the loggers
This commit is contained in:
23
test/unit/auto_release_stub.js
Normal file
23
test/unit/auto_release_stub.js
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user