Permalink
Browse files

fixed padName issue

  • Loading branch information...
1 parent 5bf6c49 commit 920f0303ec008b6d3c4812b6745d5ca7d0d5f702 @tmpvar committed May 3, 2010
Showing with 23 additions and 23 deletions.
  1. +23 −23 lib/runner.js
View
@@ -107,7 +107,7 @@ exports.run = function(testSuites) {
for (var i = 0; i<errors.length; i++)
{
sys.puts('\nFailure in ' + errors[i].suiteName + ' suite; method: ' + errors[i].method);
- sys.puts(errors[i].error.stack);
+ sys.puts(errors[i].error.stack || errors[i].error.message);
}
}
@@ -116,30 +116,30 @@ exports.run = function(testSuites) {
sys.puts(errors.length + " of " + total + " failed (" + Math.floor(((total-errors.length)/total)*100) + "% success)" );
sys.puts(" ");
} else {
- var numerator, denominator, percent;
- sys.puts("");
-
- var padName = function(name) {
- while(name.length < 13) {
- name+=" ";
- }
- return name;
- }
+
+ var numerator, denominator, percent;
+ sys.puts("");
+ var padName = function(name) {
+ while(name.length < 13) {
+ name+=" ";
+ }
+ return name;
+ };
- for (var suiteName in testSuites)
- {
- if (testSuites.hasOwnProperty(suiteName)) {
- numerator = testSuites[suiteName].total - testSuites[suiteName].errors.length;
- denominator = testSuites[suiteName].total;
- percent = Math.floor((numerator / denominator)*100) || 0;
- sys.puts(padName(suiteName) + "\t" + numerator + "/" + denominator + "\t\t" + percent + "% passing");
+ for (var suiteName in testSuites)
+ {
+ if (testSuites.hasOwnProperty(suiteName)) {
+ numerator = testSuites[suiteName].total - testSuites[suiteName].errors.length;
+ denominator = testSuites[suiteName].total;
+ percent = Math.floor((numerator / denominator)*100) || 0;
+ sys.puts(padName(suiteName) + "\t" + numerator + "/" + denominator + "\t\t" + percent + "% passing");
+ }
}
- }
- sys.puts("--------------------------------------------");
- numerator = total-errors.length;
- denominator = total;
- percent = Math.floor((numerator / denominator)*100) || 0;
- sys.puts("TOTALS:\t\t" + numerator + "/" + denominator + "\t" + percent + "% passing\r\n");
+ sys.puts("--------------------------------------------");
+ numerator = total-errors.length;
+ denominator = total;
+ percent = Math.floor((numerator / denominator)*100) || 0;
+ sys.puts("TOTALS:\t\t" + numerator + "/" + denominator + "\t" + percent + "% passing\r\n");
}
};

0 comments on commit 920f030

Please sign in to comment.