From 9715eb3a2e4a442ddaa4494460d9cca83222eafd Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 15 May 2011 22:42:02 -0400 Subject: [PATCH] small refactoring --- jasmine/jasmine.headless-reporter.coffee | 5 +++-- jasmine/jasmine.headless-reporter.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jasmine/jasmine.headless-reporter.coffee b/jasmine/jasmine.headless-reporter.coffee index 9d965ab..f362590 100644 --- a/jasmine/jasmine.headless-reporter.coffee +++ b/jasmine/jasmine.headless-reporter.coffee @@ -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 diff --git a/jasmine/jasmine.headless-reporter.js b/jasmine/jasmine.headless-reporter.js index 5170bbd..7f6947f 100644 --- a/jasmine/jasmine.headless-reporter.js +++ b/jasmine/jasmine.headless-reporter.js @@ -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;