2014-05-23 18:54:59 +00:00
|
|
|
var Filer = require('../..');
|
2014-01-21 21:25:09 +00:00
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
function MemoryTestProvider(name) {
|
|
|
|
var that = this;
|
2014-01-21 21:25:09 +00:00
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
function cleanup(callback) {
|
2014-12-17 07:54:29 +00:00
|
|
|
callback = callback || function(){};
|
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
that.provider = null;
|
|
|
|
callback();
|
|
|
|
}
|
2014-01-21 21:25:09 +00:00
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
function init() {
|
|
|
|
if(that.provider) {
|
|
|
|
return;
|
2014-01-21 21:25:09 +00:00
|
|
|
}
|
2014-05-23 18:54:59 +00:00
|
|
|
that.provider = new Filer.FileSystem.providers.Memory(name);
|
2014-01-21 21:25:09 +00:00
|
|
|
}
|
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
this.init = init;
|
|
|
|
this.cleanup = cleanup;
|
|
|
|
}
|
2014-08-16 20:22:41 +00:00
|
|
|
MemoryTestProvider.isSupported = function() {
|
|
|
|
return Filer.FileSystem.providers.Memory.isSupported();
|
|
|
|
};
|
2014-01-21 21:25:09 +00:00
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
module.exports = MemoryTestProvider;
|