From 3475c58e23d4bcaed0698cd259548e0ea3388812 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 15 Apr 2014 14:55:09 -0300 Subject: [PATCH] fix Fakestorage --- test/FakeStorage.js | 16 ++++++++++++++-- test/test.wallet.js | 3 --- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test/FakeStorage.js b/test/FakeStorage.js index dd3af45cf..ef50df677 100644 --- a/test/FakeStorage.js +++ b/test/FakeStorage.js @@ -3,12 +3,24 @@ var FakeStorage = function(){ this.storage = {}; }; -FakeStorage.prototype.set = function (id, payload) { +FakeStorage.prototype.setGlobal = function (id, payload) { this.storage[id] = payload; }; -FakeStorage.prototype.get = function(id) { +FakeStorage.prototype.getGlobal = function(id) { return this.storage[id]; } +FakeStorage.prototype.set = function (wid, id, payload) { + this.storage[wid + '-' + id] = payload; +}; + +FakeStorage.prototype.get = function(wid, id) { + return this.storage[wid + '-' +id]; +} + +FakeStorage.prototype.clear = function() { + delete this['storage']; +} + module.exports = require('soop')(FakeStorage); diff --git a/test/test.wallet.js b/test/test.wallet.js index f9b2d94f2..54a487da2 100644 --- a/test/test.wallet.js +++ b/test/test.wallet.js @@ -9,9 +9,6 @@ var Wallet = require('soop').load('../js/models/core/Wallet', { Blockchain: copay.Insight }); -console.log(Wallet); - - describe('Wallet model', function() { var config = { wallet: {