diff --git a/js/models/Storage.js b/js/models/Storage.js new file mode 100644 index 000000000..34286e9ab --- /dev/null +++ b/js/models/Storage.js @@ -0,0 +1,18 @@ +'use strict'; + +var imports = require('soop').imports(); + +function Storage() { + this.data = {}; +} + +Storage.prototype.read = function(k) { + return this.data[k]; +}; + +Storage.prototype.save = function(k,v) { + this.data[k]=v; +}; + + +module.exports = require('soop')(Storage); diff --git a/test/test.storage.js b/test/test.storage.js new file mode 100644 index 000000000..9c317e5e6 --- /dev/null +++ b/test/test.storage.js @@ -0,0 +1,15 @@ +'use strict'; + +var chai = chai || require('chai'); +var should = chai.should(); +var copay = copay || {}; +var Storage = copay.Storage || require('../js/models/Storage'); + +describe('Storage model', function() { + + it('should create an instance', function () { + var s = new Storage(); + should.exist(s); + }); +}); +