Merge branch 'javenwang-disabled-suite'

This commit is contained in:
slackersoft
2014-08-06 13:14:00 -07:00
2 changed files with 27 additions and 0 deletions

View File

@@ -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"
});
});
});

View File

@@ -35,6 +35,7 @@ getJasmineRequireObj().Suite = function() {
Suite.prototype.disable = function() {
this.disabled = true;
this.result.status = 'disabled';
};
Suite.prototype.beforeEach = function(fn) {