From the vows site: "When this.callback is called, it passes on the arguments it received to the test functions, one by one, as if the values were returned by the topic function itself." In other words if we're using the request library to handle our http requests, our topic and vow can look like:
'When I make a valid request':
topic: ->
request
uri: someURL
method: "GET"
, @callback
return undefined # necessary because I'm using coffeescript
"It should respond with a 200":
(err, resp, body) ->
assert.equal resp.statusCode, "200"
But topics that are strung together seem to play by different rules. They only seem to pass along one argument. Here's an example from the Vows site:
topic: function () {
fs.stat('~/FILE', this.callback);
},
'after a successful `fs.stat`': {
topic: function (stat) {
fs.open('~/FILE', "r", stat.mode, this.callback);}, etc
So instead of the second topic getting arugments like (err, stat), it just gets (stat).
Anybody know why this is the case?