2014-08-21 18:53:57 +00:00
|
|
|
var util = require('../lib/test-utils.js');
|
|
|
|
var expect = require('chai').expect;
|
|
|
|
|
|
|
|
describe('undefined and relative paths, issue270', function() {
|
|
|
|
beforeEach(util.setup);
|
|
|
|
afterEach(util.cleanup);
|
|
|
|
|
2019-01-02 23:07:44 +00:00
|
|
|
it('should fail with EINVAL when called on an undefined path', function() {
|
2014-08-21 18:53:57 +00:00
|
|
|
var fs = util.fs();
|
2019-01-02 23:07:44 +00:00
|
|
|
var fn = () => fs.writeFile(undefined, 'data');
|
|
|
|
expect(fn).to.throw();
|
2014-08-21 18:53:57 +00:00
|
|
|
});
|
|
|
|
|
2019-01-02 23:07:44 +00:00
|
|
|
it('should fail with EINVAL when called on a relative path', function() {
|
2014-08-21 18:53:57 +00:00
|
|
|
var fs = util.fs();
|
2019-01-02 23:07:44 +00:00
|
|
|
var fn = () => fs.writeFile('relpath/file.txt', 'data');
|
|
|
|
expect(fn).to.throw();
|
2014-08-21 18:53:57 +00:00
|
|
|
});
|
|
|
|
});
|