Skip to content

Commit

Permalink
Fix #54: Add end() method to Client.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Apr 3, 2012
1 parent a3fea60 commit 142e093
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/api/index.mustache
Expand Up @@ -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>
Expand Down
12 changes: 12 additions & 0 deletions lib/client.js
Expand Up @@ -198,6 +198,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
Expand Down
2 changes: 1 addition & 1 deletion test/functional.js
Expand Up @@ -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(),
Expand Down

0 comments on commit 142e093

Please sign in to comment.