filer/tests/lib/memory.js

28 lines
538 B
JavaScript
Raw Normal View History

var Filer = require('../../src');
2014-05-23 18:54:59 +00:00
function MemoryTestProvider(name) {
var that = this;
2014-05-23 18:54:59 +00:00
function cleanup(callback) {
callback = callback || function(){};
2014-05-23 18:54:59 +00:00
that.provider = null;
callback();
}
2014-05-23 18:54:59 +00:00
function init() {
if(that.provider) {
return;
}
2014-05-23 18:54:59 +00:00
that.provider = new Filer.FileSystem.providers.Memory(name);
}
2014-05-23 18:54:59 +00:00
this.init = init;
this.cleanup = cleanup;
}
MemoryTestProvider.isSupported = function() {
return Filer.FileSystem.providers.Memory.isSupported();
};
2014-05-23 18:54:59 +00:00
module.exports = MemoryTestProvider;