PluginManager coverage tests.

This commit is contained in:
ssotomayor 2014-10-20 12:55:18 -03:00 committed by Matias Alejo Garcia
commit f5e0dfa58d
3 changed files with 20 additions and 1 deletions

View file

@ -4,6 +4,7 @@
var _ = require('underscore');
var chai = chai || require('chai');
var should = chai.should();
var PluginManager = require('../js/models/PluginManager');
var FakeBlockchain = requireMock('FakeBlockchain');
@ -411,6 +412,14 @@ describe('Identity model', function() {
});
});
describe('#pluginManager', function() {
it('should create a new PluginManager object', function() {
var pm = sinon.stub().returns(new PluginManager({plugins: { FakeLocalStorage: true }, pluginsPath: '../../test/mocks/'}));
should.exist(pm);
});
});
describe('#joinWallet', function() {
var opts = {
secret: '8WtTuiFTkhP5ao7AF2QErSwV39Cbur6pdMebKzQXFqL59RscXM',

View file

@ -2,7 +2,12 @@
function FakeLocalStorage() {
this.ls = {};
this.type = 'DB';
};
FakeLocalStorage.prototype.init = function() {
};
FakeLocalStorage.prototype.removeItem = function(key, cb) {
delete this.ls[key];
cb();