From 95b52b9f824ba3b20d5372412ce99c753e7a5487 Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Mon, 15 Jun 2009 08:14:55 -0700 Subject: [PATCH] dwf: moved runner finished & callback test to suites --- spec/bootstrap.js | 1 - spec/suites/RunnerTest.js | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/spec/bootstrap.js b/spec/bootstrap.js index 55d2baf3..26c15c6b 100755 --- a/spec/bootstrap.js +++ b/spec/bootstrap.js @@ -284,7 +284,6 @@ var runTests = function () { runSuite('JsonReporterTest.js'); runSuite('SpyTest.js'); - testRunnerFinishCallback(); testFormatsExceptionMessages(); testHandlesExceptions(); testResultsAliasing(); diff --git a/spec/suites/RunnerTest.js b/spec/suites/RunnerTest.js index 41cfcee2..1bcf6bff 100644 --- a/spec/suites/RunnerTest.js +++ b/spec/suites/RunnerTest.js @@ -95,4 +95,23 @@ describe('RunnerTest', function() { expect(results.failedCount).toEqual(1); }); + it('should set the finished flag when #finished is called', function(){ + env.currentRunner.finish(); + + expect(env.currentRunner.finished).toEqual(true); + }); + + it('should call the finish callback when the runner is finished', function() { + var foo = 0; + + env.currentRunner.finishCallback = function() { + foo++; + }; + + env.currentRunner.finish(); + + expect(env.currentRunner.finished).toEqual(true); + expect(foo).toEqual(1); + }); + }); \ No newline at end of file