diff --git a/spec/bootstrap.js b/spec/bootstrap.js index 55d2baf..26c15c6 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 41cfcee..1bcf6bf 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