diff --git a/tests/spec/fs.write.spec.js b/tests/spec/fs.write.spec.js index 8a9cab2..7d30f90 100644 --- a/tests/spec/fs.write.spec.js +++ b/tests/spec/fs.write.spec.js @@ -4,11 +4,15 @@ var expect = require('chai').expect; 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(); + + it('should be a function', function() { + var fs = util.fs(); + expect(fs.write).to.be.a('function'); + }); + + it('should error if file path is undefined',function(done) { + var fs = util.fs(); + fs.writeFile(undefined, 'data', function(error) { expect(error).to.exist; expect(error.code).to.equal('EINVAL'); @@ -16,12 +20,6 @@ describe('fs.write', function() { }); }); - - it('should be a function', function() { - var fs = util.fs(); - expect(fs.write).to.be.a('function'); - }); - it('should write data to a file', function(done) { var fs = util.fs(); var buffer = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);