diff --git a/tests/bugs/issue254.js b/tests/bugs/issue254.js new file mode 100644 index 0000000..0d595fb --- /dev/null +++ b/tests/bugs/issue254.js @@ -0,0 +1,17 @@ +var Filer = require('../..'); +var util = require('../lib/test-utils.js'); +var expect = require('chai').expect; + +describe('fs.readFile on a dir path', function() { + beforeEach(util.setup); + afterEach(util.cleanup); + + it('should fail with EISDIR', function(done) { + var fs = util.fs(); + + fs.readFile('/', function(err) { + expect(err.code).to.equal('EISDIR'); + done(); + }); + }); +});