diff --git a/spec/core/SuiteSpec.js b/spec/core/SuiteSpec.js index 793bfea2..be884a20 100644 --- a/spec/core/SuiteSpec.js +++ b/spec/core/SuiteSpec.js @@ -106,8 +106,8 @@ describe("Suite", function() { spyOn(suite, "execute"); - parentSuite.addSpec(fakeSpec1); - parentSuite.addSuite(suite); + parentSuite.addChild(fakeSpec1); + parentSuite.addChild(suite); parentSuite.execute(parentSuiteDone); diff --git a/src/core/Env.js b/src/core/Env.js index c96da848..923f6bd0 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -223,7 +223,7 @@ getJasmineRequireObj().Env = function(j$) { var suite = suiteFactory(description); var parentSuite = currentSuite; - parentSuite.addSuite(suite); + parentSuite.addChild(suite); currentSuite = suite; var declarationError = null; @@ -302,7 +302,7 @@ getJasmineRequireObj().Env = function(j$) { this.it = function(description, fn) { var spec = specFactory(description, fn, currentSuite); - currentSuite.addSpec(spec); + currentSuite.addChild(spec); return spec; }; diff --git a/src/core/Suite.js b/src/core/Suite.js index cfadaa34..beae37ce 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -45,13 +45,8 @@ getJasmineRequireObj().Suite = function() { this.afterFns.unshift(fn); }; - Suite.prototype.addSpec = function(spec) { - this.children.push(spec); - }; - - Suite.prototype.addSuite = function(suite) { - suite.parentSuite = this; - this.children.push(suite); + Suite.prototype.addChild = function(child) { + this.children.push(child); }; Suite.prototype.execute = function(onComplete) {