Fix #456 - add test for fs.write() with undefined path
This commit is contained in:
parent
443b582038
commit
4a5d8c1222
|
@ -5,6 +5,18 @@ describe('fs.write', function() {
|
|||
beforeEach(util.setup);
|
||||
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() {
|
||||
var fs = util.fs();
|
||||
expect(fs.write).to.be.a('function');
|
||||
|
|
Loading…
Reference in New Issue