Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add teardown methods to Vows contexts.

  • Loading branch information...
commit a3fea601c5bd1740568a6bf268880d7ec88bc391 1 parent 26129b1
@reid reid authored
View
8 test/functional.js
@@ -216,6 +216,9 @@ function attachServerContext(testContext, explicitRoute) {
vow.callback(null, server);
});
},
+ teardown: function (server) {
+ server.close();
+ },
"is connected": function (server) {
assert.isNumber(server.address().port);
},
@@ -260,6 +263,10 @@ function attachServerContext(testContext, explicitRoute) {
"used by the Hub Client": {
// TODO: Handle without trailing slash.
topic: hub.clientTopic(route + "/"),
+ teardown: function (topic) {
+ // TODO Add end method, bug #54.
+ // topic.client.end();
+ },
"a browser for testing": {
topic: hub.phantomTopic(),
"visits Yeti": testContext
@@ -270,7 +277,6 @@ function attachServerContext(testContext, explicitRoute) {
}
function attachServerBatch(definition) {
-
var batch = {},
routeWords = ["foo", "bar", "baz", "quux"];
View
5 test/lib/blizzard-http.js
@@ -28,7 +28,10 @@ exports.sessionContext = function (subContext) {
server: serverBlizzardSession
});
});
-
+ },
+ teardown: function (topic) {
+ topic.client.end();
+ topic.server.end();
}
};
View
4 test/lib/blizzard.js
@@ -50,6 +50,10 @@ exports.sessionContext = function (subContext) {
});
clientSocket.once("error", vow.callback);
+ },
+ teardown: function (topic) {
+ topic.client.end();
+ topic.server.end();
}
};
View
3  test/lib/hub.js
@@ -50,6 +50,9 @@ var clientContext = exports.clientContext = function (subContext) {
});
hub.once("error", vow.callback);
},
+ teardown: function (hub) {
+ hub.close();
+ },
"is ok": function (hub) {
assert.ok(hub);
assert.isNumber(hub.server.address().port);
View
3  test/listen.js
@@ -52,6 +52,9 @@ vows.describe("Yeti Listen").addBatch({
vow.callback(null, server);
});
},
+ teardown: function (server) {
+ server.close();
+ },
"is connected": function (topic) {
assert.ok(topic.address().port);
},
Please sign in to comment.
Something went wrong with that request. Please try again.