some cleanup

This commit is contained in:
John Bintz 2011-11-21 17:03:44 -05:00
parent 7ba77ea1f9
commit a9cc872cc8
3 changed files with 11 additions and 3 deletions

View File

@ -23,7 +23,15 @@
if (window.JHW) { if (window.JHW) {
jasmine.getEnv().addReporter(new jasmine.HeadlessConsoleReporter()); jasmine.getEnv().addReporter(new jasmine.HeadlessConsoleReporter());
} else { } else {
jasmine.getEnv().addReporter(new jasmine.HtmlReporter()); types = [ 'HtmlReporter', 'TrivialReporter' ];
for (var i = 0, j = types.length; i < j; ++i) {
var type = jasmine[types[i]]
if (type) {
jasmine.getEnv().addReporter(new type());
break;
}
}
} }
jasmine.getEnv().execute(); jasmine.getEnv().execute();

View File

@ -11,7 +11,7 @@ class window.HeadlessReporterResult
bestChoice = HeadlessReporterResult.findSpecLine(@splitName) bestChoice = HeadlessReporterResult.findSpecLine(@splitName)
output += " (#{bestChoice.file}:#{bestChoice.lineNumber})".foreground('blue') if bestChoice.file output += " (#{bestChoice.file}:#{bestChoice.lineNumber})".foreground('blue') if bestChoice.file
JHW.stdout.puts "\n\n#{output}" JHW.stdout.puts "\n#{output}"
for result in @results for result in @results
output = result.message.foreground('red') output = result.message.foreground('red')
if result.lineNumber if result.lineNumber

View File

@ -15,7 +15,7 @@
if (bestChoice.file) { if (bestChoice.file) {
output += (" (" + bestChoice.file + ":" + bestChoice.lineNumber + ")").foreground('blue'); output += (" (" + bestChoice.file + ":" + bestChoice.lineNumber + ")").foreground('blue');
} }
JHW.stdout.puts("\n\n" + output); JHW.stdout.puts("\n" + output);
_ref = this.results; _ref = this.results;
_results = []; _results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {