Skip to content

rename doesn't move child files #5

@mmckegg

Description

@mmckegg

Failing test:

test('rename', function(fs, t) {
    fs.mkdir('/foo', function() {
        fs.writeFile('/foo/file', 'content', function(err){ // add a child file
            t.notOk(err);
            fs.rename('/foo', '/bar', function(err) {
                t.notOk(err);
                fs.readdir('/', function(err, list) {
                    t.notOk(err);
                    t.same(list, ['bar']);

                    // check to make sure file was moved
                    fs.readdir('/bar', function(err, list){
                        t.notOk(err);
                        t.same(list, ['content']);

                        fs.readFile('/foo/file', 'utf8', function(err, result){
                            t.ok(err)
                            t.notOk(result)
                            t.end();
                        })
                    })
                });
            });
        })
    });
});

The old file "/foo/file" still exists, and fs.readdir('/bar', cb) calls back with empty list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions