From 683b3afbc1a059ac05fa53067ec3e6071e6e31b3 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Sat, 5 Nov 2011 11:12:50 -0400 Subject: [PATCH] cake test: count number of complete tests that pass, not assertions --- Cakefile | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Cakefile b/Cakefile index d598666d..f7545f35 100644 --- a/Cakefile +++ b/Cakefile @@ -161,16 +161,7 @@ runTests = (CoffeeScript) -> passedTests = 0 failures = [] - # Make "global" reference available to tests - global.global = global - - # Mix in the assert module globally, to make it available for tests. - addGlobal = (name, func) -> - global[name] = -> - passedTests += 1 - func arguments... - - addGlobal name, func for name, func of require 'assert' + global[name] = func for name, func of require 'assert' # Convenience aliases. global.eq = global.strictEqual @@ -181,6 +172,7 @@ runTests = (CoffeeScript) -> try fn.test = {description, currentFile} fn.call(fn) + ++passedTests catch e e.description = description if description? e.source = fn.toString() if fn.toString?