diff --git a/spec/runner.html b/spec/runner.html index 7ce2e7f..8f71893 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -29,6 +29,7 @@ + @@ -50,6 +51,7 @@ + diff --git a/spec/suites/TrivialConsoleReporterSpec.js b/spec/suites/TrivialConsoleReporterSpec.js new file mode 100644 index 0000000..c1ada66 --- /dev/null +++ b/spec/suites/TrivialConsoleReporterSpec.js @@ -0,0 +1,429 @@ +describe("TrivialConsoleReporter", function() { + + + //keep these literal. otherwise the test loses value as a test. + function green(str) { return '\033[32m' + str + '\033[0m'; } + function red(str) { return '\033[31m' + str + '\033[0m'; } + function yellow(str) { return '\033[33m' + str + '\033[0m'; } + + function prefixGreen(str) { return '\033[32m' + str; } + function prefixRed(str) { return '\033[31m' + str; } + + var newline = "\n"; + + var passingSpec = { results: function(){ return {passed: function(){return true;}}; } }, + failingSpec = { results: function(){ return {passed: function(){return false;}}; } }, + skippedSpec = { results: function(){ return {skipped: true}; } }, + passingRun = { results: function(){ return {failedCount: 0, items_: [null, null, null]}; } }, + failingRun = { results: function(){ return {failedCount: 7, items_: [null, null, null]}; } }; + + function repeatedlyInvoke(f, times) { for(var i=0; i 0 && spec.description) suiteResult.failedSpecResults.push(spec); + }); + + this.suiteResults.push(suiteResult); + }; + + function eachSpecFailure(suiteResults, callback) { + for(var i=0; i