Skip to content

Commit

Permalink
(test) test for multiple arguments in callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jan 29, 2011
1 parent 1c18b66 commit 3030206
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/vows-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,25 @@ vows.describe("Vows").addBatch({
"should work the same as returning a value": function (res) {
assert.equal(res, 'hello');
}
},
"with multiple arguments": {
topic: function () {
this.callback(null, 1, 2, 3);
},
"should pass them to the vow": function (e, a, b, c) {
assert.strictEqual(e, null);
assert.strictEqual(a, 1);
assert.strictEqual(b, 2);
assert.strictEqual(c, 3);
},
"and a sub-topic": {
topic: function (a, b, c) {
return [a, b, c];
},
"should receive them too": function (val) {
assert.deepEqual(val, [1, 2, 3]);
}
}
}
}
}).addBatch({
Expand Down

0 comments on commit 3030206

Please sign in to comment.