diff --git a/tests/spec/fs.appendFile.spec.js b/tests/spec/fs.appendFile.spec.js index c0c66a1..c6585c4 100644 --- a/tests/spec/fs.appendFile.spec.js +++ b/tests/spec/fs.appendFile.spec.js @@ -110,6 +110,20 @@ define(["Filer", "util"], function(Filer, util) { }); }); }); - }); + it('should work when file does not exist, and create the file', function(done) { + var fs = util.fs(); + var contents = "This is a file."; + + fs.appendFile('/newfile', contents, { encoding: 'utf8' }, function(error) { + expect(error).not.to.exist; + + fs.readFile('/newfile', 'utf8', function(err, data) { + if(err) throw err; + expect(data).to.equal(contents); + done(); + }); + }); + }); + }); });