From a447b2dd4555851410ad781c41394174d10416bd Mon Sep 17 00:00:00 2001 From: VictorKubrak <41162246+VictorKubrak@users.noreply.github.com> Date: Tue, 16 Oct 2018 09:43:44 -0400 Subject: [PATCH] rename() should be able to rename an existing file to the same filename (#502) * rename should not change name to itself * new test expects failure * should rename an existing file to itself * should rename an existing file to itself * Update tests/spec/fs.rename.spec.js * add .skip to the test --- tests/spec/fs.rename.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/spec/fs.rename.spec.js b/tests/spec/fs.rename.spec.js index 51959c2..b58ee11 100644 --- a/tests/spec/fs.rename.spec.js +++ b/tests/spec/fs.rename.spec.js @@ -10,6 +10,23 @@ describe('fs.rename', function() { expect(fs.rename).to.be.a('function'); }); + it.skip('should be able to rename an existing file to the same filename', function(done) { + var fs = util.fs(); + + fs.open('/myfile', 'w+', function(error, fd) { + if(error) throw error; + + fs.close(fd, function(error) { + if(error) throw error; + + fs.rename('/myfile', '/myfile', function(error) { + expect(error).not.to.exist; + done(); + }); + }); + }); + }); + it('should rename an existing file', function(done) { var complete1 = false; var complete2 = false;