Permalink
Browse files

Fix #54: Add end() method to Client.

  • Loading branch information...
1 parent a3fea60 commit 142e09347510e32dfafb1fd1bad6f3f25e6d1d9b @reid reid committed Apr 3, 2012
Showing with 19 additions and 1 deletion.
  1. +6 −0 doc/api/index.mustache
  2. +12 −0 lib/client.js
  3. +1 −1 test/functional.js
View
6 doc/api/index.mustache
@@ -113,6 +113,12 @@ Emitted when an Agent requests a page (test or capture) from the connected Hub.
Begin the connection to the Hub.
</p>
+<h4>client.end()</h4>
+
+<p>
+End the connection to the Hub.
+</p>
+
<h4>client.createBatch([configuration])</h4>
<p>
View
12 lib/client.js
@@ -199,6 +199,18 @@ Client.prototype.connect = function (cb) {
};
/**
+ * Disconnect from the Yeti Hub.
+ *
+ * @method end
+ */
+Client.prototype.end = function () {
+ if (!this.session) {
+ throw new Error("Session not started.");
+ }
+ this.session.end();
+};
+
+/**
* @method handleBlizzardError
* @protected
*/
View
2 test/functional.js
@@ -265,7 +265,7 @@ function attachServerContext(testContext, explicitRoute) {
topic: hub.clientTopic(route + "/"),
teardown: function (topic) {
// TODO Add end method, bug #54.
- // topic.client.end();
+ topic.client.end();
},
"a browser for testing": {
topic: hub.phantomTopic(),

0 comments on commit 142e093

Please sign in to comment.