Fix tabManager tests

pull/9/merge
Nikolai Onken 2015-02-11 21:36:17 +00:00
rodzic 0767d54dde
commit 363f4412d5
1 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -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();
});
});
});
});