Add Dummy Storage class
This commit is contained in:
parent
7141dee5c8
commit
6b2d3cda35
2 changed files with 33 additions and 0 deletions
18
js/models/Storage.js
Normal file
18
js/models/Storage.js
Normal file
|
|
@ -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);
|
||||||
15
test/test.storage.js
Normal file
15
test/test.storage.js
Normal file
|
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue