small refactoring

This commit is contained in:
John Bintz 2011-05-15 22:42:02 -04:00
parent fd3e8218d7
commit 9715eb3a2e
2 changed files with 7 additions and 5 deletions

View File

@ -27,12 +27,13 @@ class jasmine.HeadlessReporter
reportRunnerStarting: (runner) ->
@startTime = new Date()
reportSpecResults: (spec) ->
if spec.results().passed()
results = spec.results()
if results.passed()
JHW.specPassed()
else
JHW.specFailed()
failureResult = new HeadlessReporterResult(spec.getFullName())
for result in spec.results().getItems()
for result in results.getItems()
do (result) =>
if result.type == 'expect' and !result.passed_
@failedCount += 1

View File

@ -49,13 +49,14 @@
return this.startTime = new Date();
};
HeadlessReporter.prototype.reportSpecResults = function(spec) {
var failureResult, result, _fn, _i, _len, _ref;
if (spec.results().passed()) {
var failureResult, result, results, _fn, _i, _len, _ref;
results = spec.results();
if (results.passed()) {
return JHW.specPassed();
} else {
JHW.specFailed();
failureResult = new HeadlessReporterResult(spec.getFullName());
_ref = spec.results().getItems();
_ref = results.getItems();
_fn = __bind(function(result) {
if (result.type === 'expect' && !result.passed_) {
this.failedCount += 1;