2018-06-28 23:26:08 +00:00
|
|
|
var Filer = require('../../src');
|
2014-05-23 21:01:57 +00:00
|
|
|
var expect = require('chai').expect;
|
2014-01-14 15:56:36 +00:00
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
describe('Filer', function() {
|
|
|
|
it('is defined', function() {
|
2014-05-23 20:53:50 +00:00
|
|
|
expect(typeof Filer).not.to.equal(undefined);
|
2014-01-14 15:56:36 +00:00
|
|
|
});
|
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
it('has FileSystem constructor', function() {
|
2014-05-23 20:53:50 +00:00
|
|
|
expect(typeof Filer.FileSystem).to.equal('function');
|
|
|
|
});
|
2014-10-17 16:28:03 +00:00
|
|
|
|
2018-07-15 17:25:35 +00:00
|
|
|
it('has Shell constructor', function() {
|
2014-10-17 16:28:03 +00:00
|
|
|
expect(typeof Filer.Shell).to.equal('function');
|
|
|
|
});
|
2014-04-18 23:26:41 +00:00
|
|
|
|
|
|
|
it('must honor the \'FORMAT\' flag', function(done) {
|
|
|
|
var fs = new Filer.FileSystem({name: 'local-test'});
|
|
|
|
var fs2 = new Filer.FileSystem({name: 'local-test'});
|
|
|
|
|
|
|
|
fs.mkdir('/test', function(err){
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
fs2.readdir('/', function(err, list) {
|
|
|
|
if(err) throw err;
|
|
|
|
|
|
|
|
expect(list).to.exist;
|
|
|
|
expect(list).to.have.length(1);
|
|
|
|
|
|
|
|
fs2 = new Filer.FileSystem({name: 'local-test', flags:['FORMAT']});
|
|
|
|
fs2.readdir('/', function(err, list2) {
|
|
|
|
expect(err).to.not.exist;
|
|
|
|
expect(list2).to.exist;
|
|
|
|
expect(list2).to.have.length(0);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2014-05-23 20:53:50 +00:00
|
|
|
});
|