Refactor Suite.addSpec and .addSuite to .addChild
This commit is contained in:
@@ -106,8 +106,8 @@ describe("Suite", function() {
|
|||||||
|
|
||||||
spyOn(suite, "execute");
|
spyOn(suite, "execute");
|
||||||
|
|
||||||
parentSuite.addSpec(fakeSpec1);
|
parentSuite.addChild(fakeSpec1);
|
||||||
parentSuite.addSuite(suite);
|
parentSuite.addChild(suite);
|
||||||
|
|
||||||
parentSuite.execute(parentSuiteDone);
|
parentSuite.execute(parentSuiteDone);
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
var suite = suiteFactory(description);
|
var suite = suiteFactory(description);
|
||||||
|
|
||||||
var parentSuite = currentSuite;
|
var parentSuite = currentSuite;
|
||||||
parentSuite.addSuite(suite);
|
parentSuite.addChild(suite);
|
||||||
currentSuite = suite;
|
currentSuite = suite;
|
||||||
|
|
||||||
var declarationError = null;
|
var declarationError = null;
|
||||||
@@ -302,7 +302,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
|
|
||||||
this.it = function(description, fn) {
|
this.it = function(description, fn) {
|
||||||
var spec = specFactory(description, fn, currentSuite);
|
var spec = specFactory(description, fn, currentSuite);
|
||||||
currentSuite.addSpec(spec);
|
currentSuite.addChild(spec);
|
||||||
return spec;
|
return spec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,8 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
this.afterFns.unshift(fn);
|
this.afterFns.unshift(fn);
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.addSpec = function(spec) {
|
Suite.prototype.addChild = function(child) {
|
||||||
this.children.push(spec);
|
this.children.push(child);
|
||||||
};
|
|
||||||
|
|
||||||
Suite.prototype.addSuite = function(suite) {
|
|
||||||
suite.parentSuite = this;
|
|
||||||
this.children.push(suite);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.execute = function(onComplete) {
|
Suite.prototype.execute = function(onComplete) {
|
||||||
|
|||||||
Reference in New Issue
Block a user