diff --git a/tests/spec/fs.open.spec.js b/tests/spec/fs.open.spec.js index 819b1ba..241faf8 100644 --- a/tests/spec/fs.open.spec.js +++ b/tests/spec/fs.open.spec.js @@ -1,6 +1,7 @@ var util = require('../lib/test-utils.js'); var expect = require('chai').expect; var { FIRST_DESCRIPTOR } = require('../../src/constants.js'); +var Constants = require('../../src/constants.js'); describe('fs.open', function() { beforeEach(util.setup); @@ -33,6 +34,17 @@ describe('fs.open', function() { }); }); + it('should create a file when passed the flag as a bitwise number', function(done) { + var fs = util.fs(); + + fs.open('/myfile', Constants.fsConstants.O_CREAT, function(error, fd) { + expect(error).not.to.exist; + expect(fd).to.exist; + fs.close(fd); + done(); + }); + }); + it('should return an error when flagged for write and the path is a directory', function(done) { var fs = util.fs();