Fix #456 - add test for fs.write() with undefined path
This commit is contained in:
parent
443b582038
commit
4a5d8c1222
|
@ -4,6 +4,18 @@ var expect = require('chai').expect;
|
||||||
describe('fs.write', function() {
|
describe('fs.write', function() {
|
||||||
beforeEach(util.setup);
|
beforeEach(util.setup);
|
||||||
afterEach(util.cleanup);
|
afterEach(util.cleanup);
|
||||||
|
|
||||||
|
// if the file is undefined, it will create problems
|
||||||
|
//
|
||||||
|
it('should be a error',function(done){
|
||||||
|
var fs=util.fs();
|
||||||
|
fs.writeFile(undefined, 'data', function(error) {
|
||||||
|
expect(error).to.exist;
|
||||||
|
expect(error.code).to.equal('EINVAL');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should be a function', function() {
|
it('should be a function', function() {
|
||||||
var fs = util.fs();
|
var fs = util.fs();
|
||||||
|
|
Loading…
Reference in New Issue