diff --git a/plugins/c9.ide.editors/tabmanager_test.js b/plugins/c9.ide.editors/tabmanager_test.js index 71b72589..6f2c683a 100644 --- a/plugins/c9.ide.editors/tabmanager_test.js +++ b/plugins/c9.ide.editors/tabmanager_test.js @@ -247,20 +247,22 @@ require(["lib/architect/architect", "lib/chai/chai"], it('should rename a directory - change tab path', function(done) { var vpath = "/dir/stuff.json"; - tabs.openFile(vpath, function(err, tab) { - expect(tab.path).to.equal(vpath); - expect(tab.title).to.equal("stuff.json"); - - fs.rename("/dir", "/dir2", function(err) { - if (err) - throw err; - expect(tab.path).to.equal("/dir2/stuff.json"); + fs.rmdir("/dir2", { recursive: true }, function(){ + tabs.openFile(vpath, function(err, tab) { + expect(tab.path).to.equal(vpath); expect(tab.title).to.equal("stuff.json"); - tab.unload(); - fs.rename("/dir2", "/dir", function (err) { + + fs.rename("/dir", "/dir2", function(err) { if (err) throw err; - done(); + expect(tab.path).to.equal("/dir2/stuff.json"); + expect(tab.title).to.equal("stuff.json"); + tab.unload(); + fs.rename("/dir2", "/dir", function (err) { + if (err) + throw err; + done(); + }); }); }); });