diff --git a/tests/spec/fs.chown.spec.js b/tests/spec/fs.chown.spec.js index d6de220..f89c2b6 100644 --- a/tests/spec/fs.chown.spec.js +++ b/tests/spec/fs.chown.spec.js @@ -62,3 +62,27 @@ describe('fs.chown, fs.fchown', function() { }); }); }); + + +describe('fs.promises.chown', function(){ + beforeEach(util.setup); + afterEach(util.setup); + + it('should be a function', function(){ + var fsPromises = util.fs().promises; + expect(fsPromises.chown).to.be.a('function'); + }); + + it('should allow updating uid and gid for a file', function() { + var fsPromises = util.fs().promises; + return fsPromises.writeFile('/file', 'data') + .then(() => + fsPromises.chown('/file', 500, 500)) + .then(() => + fsPromises.stat('/file')) + .then((stats) =>{ + expect(stats.uid).to.equal(500); + expect(stats.gid).to.equal(500); + }); + }); +});