Fixed tests

This commit is contained in:
Ruben Daniels 2015-05-01 16:31:49 +00:00
parent bde9054f84
commit 71f2d769d9
5 changed files with 25 additions and 6 deletions

6
node_modules/vfs-local/localfs.js generated vendored
View File

@ -2339,6 +2339,9 @@ module.exports = function setup(fsOptions) {
err.code = "EEXIST";
return callback(err, { api: apis[name] });
}
if (options.redefine && apis[name] && apis[name].destroy)
apis[name].destroy();
var fn;
@ -2399,6 +2402,9 @@ module.exports = function setup(fsOptions) {
}
function unextend(name, options, callback) {
if (apis[name] && apis[name].destroy)
apis[name].destroy();
delete apis[name];
callback(null, {});
}

View File

@ -83,7 +83,7 @@
"c9.ide.help.support": "#60e88f5680",
"c9.ide.imgeditor": "#08bbc53578",
"c9.ide.immediate": "#6845a93705",
"c9.ide.installer": "#2dcd0acc76",
"c9.ide.installer": "#312b28d5e8",
"c9.ide.mount": "#32e79866ee",
"c9.ide.navigate": "#64156c7f4a",
"c9.ide.newresource": "#f1f0624768",

View File

@ -21,10 +21,13 @@ module.exports = function (vfs, options, register) {
client.on("error", function(err){
if (err.code == "ECONNREFUSED") {
require("fs").unlink(SOCKET, function(){
require("fs").unlink(SOCKET, function(){
createListenServer(api);
});
}
else if (err.code == "ENOENT") {
createListenServer(api);
}
else
api.onError(err);
});
@ -42,7 +45,11 @@ module.exports = function (vfs, options, register) {
return client;
}
function createListenServer(api){
function createListenServer(api){
// var timeout = setTimeout(function(){
// unixServer.close();
// }, 500);
var unixServer = net.createServer(function(client) {
client.setEncoding("utf8");
@ -98,7 +105,8 @@ module.exports = function (vfs, options, register) {
}
};
createListenServer(api);
// createListenServer
createListenClient(api);
stream.write = function(data){
if (client) client.write(data);
@ -111,6 +119,10 @@ module.exports = function (vfs, options, register) {
stream = null;
delete this.api;
},
destroy: function(){
this.disconnect();
}
});
};

View File

@ -71,9 +71,9 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "/vfs-home"],
it('send and receive messages', function(done) {
bridge.on("message", function(e){
if (e.message.hello) {
e.respond({ "hi": true });
e.respond(null, { "hi": true });
}
})
});
client.send({ "hello": true }, function(err, message){
if (err) throw err.message;
expect(message).property("hi").to.be.ok;

View File

@ -140,6 +140,7 @@ define(function(require, exports, module) {
cmd.addCommand({
name: "remove",
alias: "uninstall",
info: " Removes a cloud9 package.",
usage: "[--verbose] [--global] [--local] <package>", // @TODO --global
options: {