diff --git a/spec/core/SuiteSpec.js b/spec/core/SuiteSpec.js index bc1b7c96..793bfea2 100644 --- a/spec/core/SuiteSpec.js +++ b/spec/core/SuiteSpec.js @@ -67,54 +67,6 @@ describe("Suite", function() { expect(suite.afterFns).toEqual([innerAfter, outerAfter]); }); - it("adds specs", function() { - var env = new j$.Env(), - fakeQueue = { - add: jasmine.createSpy() - }, - suite = new j$.Suite({ - env: env, - description: "I am a suite", - queueFactory: function() { - return fakeQueue - } - }), - fakeSpec = {}; - - expect(suite.children_.length).toEqual(0); - - suite.addSpec(fakeSpec); - - expect(suite.children_.length).toEqual(1); - }); - - it("adds suites", function() { - var env = new j$.Env(), - fakeQueue = { - add: jasmine.createSpy() - }, - suite = new j$.Suite({ - env: env, - description: "I am a suite", - queueFactory: function() { - return fakeQueue - } - }), - anotherSuite = new j$.Suite({ - env: env, - description: "I am another suite", - queueFactory: function() { - return fakeQueue - } - }); - - expect(suite.children_.length).toEqual(0); - - suite.addSuite(anotherSuite); - - expect(suite.children_.length).toEqual(1); - }); - it("can be disabled", function() { var env = new j$.Env(), fakeQueueRunner = jasmine.createSpy('fake queue runner'), diff --git a/src/core/Suite.js b/src/core/Suite.js index 09a2c9b5..cfadaa34 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -13,7 +13,7 @@ getJasmineRequireObj().Suite = function() { this.queueRunner = attrs.queueRunner || function() {}; this.disabled = false; - this.children_ = []; // TODO: rename + this.children = []; this.result = { id: this.id, @@ -46,16 +46,12 @@ getJasmineRequireObj().Suite = function() { }; Suite.prototype.addSpec = function(spec) { - this.children_.push(spec); + this.children.push(spec); }; Suite.prototype.addSuite = function(suite) { suite.parentSuite = this; - this.children_.push(suite); - }; - - Suite.prototype.children = function() { - return this.children_; + this.children.push(suite); }; Suite.prototype.execute = function(onComplete) { @@ -65,11 +61,10 @@ getJasmineRequireObj().Suite = function() { return; } - var allFns = [], - children = this.children_; + var allFns = []; - for (var i = 0; i < children.length; i++) { - allFns.push(wrapChildAsAsync(children[i])); + for (var i = 0; i < this.children.length; i++) { + allFns.push(wrapChildAsAsync(this.children[i])); } this.onStart(this); @@ -91,7 +86,7 @@ getJasmineRequireObj().Suite = function() { return function(done) { child.execute(done); }; } }; - + return Suite; };