Skip to content

Commit

Permalink
track vows and vow statuses in batches
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 17, 2010
1 parent 8917efe commit e1d1ea5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function addVow(vow) {
var batch = vow.batch;

batch.total ++;
batch.vows.push(vow);

return this.addListener("success", function () {
var args = Array.prototype.slice.call(arguments);
Expand Down Expand Up @@ -111,6 +112,8 @@ function addVow(vow) {
}

function output(status, exception) {
vow.status = status;

if (vow.context && batch.lastContext !== vow.context) {
batch.lastContext = vow.context;
batch.suite.report(['context', vow.context]);
Expand Down
3 changes: 3 additions & 0 deletions lib/vows/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ this.Suite.prototype = new(function () {
b.lastContext = null;
b.remaining = b._remaining;
b.honored = b.broken = b.errored = b.total = b.pending = 0;
b.vows.forEach(function (vow) { vow.status = null });
});
};

this.addBatch = function (tests) {
this.batches.push({
tests: tests,
suite: this,
vows: [],
remaining: 0,
_remaining: 0,
honored: 0,
Expand Down Expand Up @@ -172,6 +174,7 @@ this.Suite.prototype = new(function () {
context: ctx.name,
description: item,
binding: ctx.env,
status: null,
batch: batch
});

Expand Down

0 comments on commit e1d1ea5

Please sign in to comment.