mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow multiple instances of a given storage module to exist
This commit is contained in:
@@ -151,14 +151,13 @@ describe('context', function() {
|
||||
var stubDelete = sinon.stub();
|
||||
var contextStorage={
|
||||
test:{
|
||||
module: {
|
||||
init: function() {
|
||||
return true;
|
||||
},
|
||||
get: stubGet,
|
||||
set: stubSet,
|
||||
keys: stubKeys,
|
||||
delete: stubDelete
|
||||
module: function(config){
|
||||
function Test(){}
|
||||
Test.prototype.get = stubGet;
|
||||
Test.prototype.set = stubSet;
|
||||
Test.prototype.keys = stubKeys;
|
||||
Test.prototype.delete = stubDelete;
|
||||
return new Test(config);
|
||||
},
|
||||
config:{}
|
||||
}
|
||||
@@ -228,14 +227,13 @@ describe('context', function() {
|
||||
var contextDefaultStorage={
|
||||
default: "test",
|
||||
test:{
|
||||
module: {
|
||||
init: function() {
|
||||
return true;
|
||||
},
|
||||
get: stubGet,
|
||||
set: stubSet,
|
||||
keys: stubKeys,
|
||||
delete: stubDelete
|
||||
module: function(config){
|
||||
function Test(){}
|
||||
Test.prototype.get = stubGet;
|
||||
Test.prototype.set = stubSet;
|
||||
Test.prototype.keys = stubKeys;
|
||||
Test.prototype.delete = stubDelete;
|
||||
return new Test(config);
|
||||
},
|
||||
config:{}
|
||||
}
|
||||
|
@@ -17,23 +17,21 @@
|
||||
var should = require('should');
|
||||
var fs = require('fs-extra');
|
||||
var path = require("path");
|
||||
var context = require('../../../../../red/runtime/nodes/context/localfilesystem');
|
||||
var LocalFileSystem = require('../../../../../red/runtime/nodes/context/localfilesystem');
|
||||
|
||||
var resourcesDir = path.resolve(path.join(__dirname,"..","resources","context"));
|
||||
|
||||
describe('localfilesystem',function() {
|
||||
var context;
|
||||
|
||||
beforeEach(function() {
|
||||
context.init({dir: resourcesDir});
|
||||
context = LocalFileSystem({dir: resourcesDir});
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
context.delete("nodeX");
|
||||
context.delete("nodeY");
|
||||
});
|
||||
|
||||
after(function() {
|
||||
fs.removeSync(resourcesDir);
|
||||
afterEach(function(done) {
|
||||
fs.remove(resourcesDir).then(function(result){
|
||||
return done(result);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#get/set',function() {
|
||||
|
@@ -15,12 +15,13 @@
|
||||
**/
|
||||
|
||||
var should = require('should');
|
||||
var context = require('../../../../../red/runtime/nodes/context/memory');
|
||||
var Memory = require('../../../../../red/runtime/nodes/context/memory');
|
||||
|
||||
describe('memory',function() {
|
||||
var context;
|
||||
|
||||
beforeEach(function() {
|
||||
context.init({});
|
||||
context = Memory({});
|
||||
});
|
||||
|
||||
describe('#get/set',function() {
|
||||
|
Reference in New Issue
Block a user