Merge pull request #873 from matiu/feature/test01

Feature/test01
This commit is contained in:
Gustavo Maximiliano Cortez 2014-07-08 20:13:23 -03:00
commit d91c42ee30
11 changed files with 273 additions and 247 deletions

View file

@ -0,0 +1,27 @@
//localstorage Mock
ls = {};
function LocalStorage(opts) {}
FakeLocalStorage = {};
FakeLocalStorage.length = 0;
FakeLocalStorage.removeItem = function(key) {
delete ls[key];
this.length = Object.keys(ls).length;
};
FakeLocalStorage.getItem = function(k) {
return ls[k];
};
FakeLocalStorage.key = function(i) {
return Object.keys(ls)[i];
};
FakeLocalStorage.setItem = function(k, v) {
ls[k] = v;
this.key[this.length] = k;
this.length = Object.keys(ls).length;
};
module.exports = require('soop')(FakeLocalStorage);