Failing test for issue #239

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-07-16 15:23:11 -04:00
parent 2c005d0390
commit 2992f7417b
2 changed files with 22 additions and 0 deletions

21
tests/bugs/issue239.js Normal file
View File

@ -0,0 +1,21 @@
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.writeFile and non-existing directory, issue 239', function() {
beforeEach(util.setup);
afterEach(util.cleanup);
it('should give ENOENT if writing to a dir that does not exist', function(done) {
var fs = util.fs();
fs.writeFile('/abc.txt', 'content', function(err) {
expect(err).not.to.exist;
fs.writeFile('/abc.txt/abc.txt', 'content', function(err) {
expect(err.code).to.equal('ENOENT');
done();
});
});
});
});

View File

@ -67,3 +67,4 @@ require("./spec/node-js/simple/test-fs-watch-recursive");
// NOTE: bugs/issue225.js has to be run outside this step, see gruntfile.js
require("./bugs/issue105");
require("./bugs/issue106");
require("./bugs/issue239");