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) {
|
|
|
|
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-01-21 21:25:09 +00:00
|
|
|
|
2014-05-23 18:54:59 +00:00
|
|
|
module.exports = MemoryTestProvider;
|