Skip to content

Commit

Permalink
[test] Added test to ensure all producers are removed when a client c…
Browse files Browse the repository at this point in the history
…loses
  • Loading branch information
jcrugzz authored and indexzero committed Feb 11, 2013
1 parent dae6214 commit 30fd0c6
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions test/net/client-test.js
Expand Up @@ -13,9 +13,25 @@ var assert = require('assert'),
macros = require('../macros');

vows.describe('godot/net/client').addBatch({
"Godot client": macros.net.shouldSendDataOverBoth({
producers: [
godot.producer(helpers.fixtures['producer-test'])
]
})
}).export(module);
"Godot client": macros.net.shouldSendDataOverBoth(
{
producers: [
godot.producer(helpers.fixtures['producer-test'])
]
},
{
"on close": {
topic: function() {
var client = this.client;
client.close();
this.callback();
},
"should remove all producers": function () {
var client = this.client;
assert.isObject(client.producers);
assert.isEmpty(client.producers);
}
}
}
)
}).export(module);

0 comments on commit 30fd0c6

Please sign in to comment.