diff --git a/spec/core/SuiteSpec.js b/spec/core/SuiteSpec.js index be884a20..a51b4ca1 100644 --- a/spec/core/SuiteSpec.js +++ b/spec/core/SuiteSpec.js @@ -179,4 +179,30 @@ describe("Suite", function() { fullName: "with a child suite" }); }); + + it("calls a provided result callback with status being disabled when disabled and done", function() { + var env = new j$.Env(), + suiteResultsCallback = jasmine.createSpy('suite result callback'), + fakeQueueRunner = function(attrs) { attrs.onComplete(); }, + suite = new j$.Suite({ + env: env, + description: "with a child suite", + queueRunner: fakeQueueRunner, + resultCallback: suiteResultsCallback + }), + fakeSpec1 = { + execute: jasmine.createSpy('fakeSpec1') + }; + + suite.disable(); + + suite.execute(); + + expect(suiteResultsCallback).toHaveBeenCalledWith({ + id: suite.id, + status: 'disabled', + description: "with a child suite", + fullName: "with a child suite" + }); + }); }); diff --git a/src/core/Suite.js b/src/core/Suite.js index 4b5e573d..8c67d6ce 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -35,6 +35,7 @@ getJasmineRequireObj().Suite = function() { Suite.prototype.disable = function() { this.disabled = true; + this.result.status = 'disabled'; }; Suite.prototype.beforeEach = function(fn) {