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
This commit is contained in:
parent
8aa8dda4d6
commit
a447b2dd45
|
@ -10,6 +10,23 @@ describe('fs.rename', function() {
|
||||||
expect(fs.rename).to.be.a('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) {
|
it('should rename an existing file', function(done) {
|
||||||
var complete1 = false;
|
var complete1 = false;
|
||||||
var complete2 = false;
|
var complete2 = false;
|
||||||
|
|
Loading…
Reference in New Issue