From 1775c24d37cdc36b634d8dbc68f466d8426687fd Mon Sep 17 00:00:00 2001 From: Petr Bouianov Date: Fri, 18 Apr 2014 19:26:41 -0400 Subject: [PATCH] Fixes issue 75 As the array flags were already reflected in the README documentation and example, this only required a test --- tests/spec/filer.spec.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/spec/filer.spec.js b/tests/spec/filer.spec.js index 0d9b610..19cac28 100644 --- a/tests/spec/filer.spec.js +++ b/tests/spec/filer.spec.js @@ -13,4 +13,28 @@ describe('Filer', function() { it('has Shell constructor', function() { expect(typeof Filer.Shell).to.equal('function'); }); + + 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(); + }); + }); + }); + }); });