From e1d1ea5619d3c1e6e38b5d615f26d7e91a3696f0 Mon Sep 17 00:00:00 2001
From: cloudhead <self@cloudhead.net>
Date: Thu, 17 Jun 2010 19:30:16 -0400
Subject: [PATCH] track vows and vow statuses in batches

---
 lib/vows.js       | 3 +++
 lib/vows/suite.js | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/lib/vows.js b/lib/vows.js
index 20da5d0..059dd10 100644
--- a/lib/vows.js
+++ b/lib/vows.js
@@ -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);
@@ -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]);
diff --git a/lib/vows/suite.js b/lib/vows/suite.js
index 244988a..74687fd 100644
--- a/lib/vows/suite.js
+++ b/lib/vows/suite.js
@@ -28,6 +28,7 @@ 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 });
         });
     };
 
@@ -35,6 +36,7 @@ this.Suite.prototype = new(function () {
         this.batches.push({
             tests: tests,
             suite:  this,
+            vows:     [],
             remaining: 0,
            _remaining: 0,
             honored:   0,
@@ -172,6 +174,7 @@ this.Suite.prototype = new(function () {
                     context: ctx.name,
                     description: item,
                     binding: ctx.env,
+                    status: null,
                     batch: batch
                 });