Prevents *Alls from running when runnables are explicitly set

- This requires passing if runnables are set to the Suite. Hopefully in
  the future we will change how focused runnables and *Alls interact so
  this is no longer necessary.

[#732]
This commit is contained in:
Greg Cobb
2015-01-23 17:27:13 -08:00
parent 1936a36c79
commit ebbaab4cf9
5 changed files with 82 additions and 18 deletions
+26
View File
@@ -117,6 +117,32 @@ describe("Suite", function() {
expect(lastAfter).toHaveBeenCalled();
});
it("does not run *All functions if runnables are explicitly set", function(){
var env = new j$.Env(),
fakeQueueRunner = jasmine.createSpy('fake queue runner'),
suite = new j$.Suite({
env: env,
description: "I am a suite",
queueRunner: fakeQueueRunner,
runnablesExplictlySetGetter: function(){return true;}
}),
beforeAll = jasmine.createSpy('beforeAll'),
afterAll = jasmine.createSpy('afterAll'),
fakeIt = {execute: jasmine.createSpy('it'), isExecutable: function() { return true; } };
suite.beforeAll(beforeAll);
suite.afterAll(afterAll);
suite.addChild(fakeIt);
suite.execute();
var suiteFns = fakeQueueRunner.calls.mostRecent().args[0].queueableFns;
expect(suite.isExecutable()).toBeFalsy();
expect(suiteFns.length).toEqual(1);
expect(beforeAll).not.toHaveBeenCalled();
expect(afterAll).not.toHaveBeenCalled();
});
it("can be disabled, but still calls callbacks", function() {
var env = new j$.Env(),
fakeQueueRunner = jasmine.createSpy('fake queue runner'),