a disabled suite should call resultCallback with status being disabled

close #574
This commit is contained in:
Javen Wang
2014-04-12 19:18:59 +08:00
committed by slackersoft
parent b4f49db6bd
commit 2b0be0c74b
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) {