specs() refactor, added test coverage

This commit is contained in:
ragaskar
2009-09-02 07:30:31 -07:00
parent 50134eb1ac
commit 4533d6a7cd
20 changed files with 107 additions and 70 deletions

View File

@@ -27,7 +27,7 @@ jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
children: []
};
if (isSuite) {
var specs = suiteOrSpec.getSpecs();
var specs = suiteOrSpec.specs();
for (var i = 0; i < specs.length; i++) {
summary.children.push(this.summarize_(specs[i]));
}

View File

@@ -16,7 +16,7 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
self.env = env;
self.beforeQueue = [];
self.afterQueue = [];
self.specs = [];
self.specs_ = [];
};
jasmine.Suite.prototype.getFullName = function() {
@@ -53,17 +53,17 @@ jasmine.Suite.prototype.add = function(block) {
if (block instanceof jasmine.Suite) {
this.env.currentRunner.addSuite(block);
} else {
this.specs.push(block);
this.specs_.push(block);
}
this.queue.add(block);
};
jasmine.Suite.prototype.specCount = function() {
return this.specs.length;
return this.specs_.length;
};
jasmine.Suite.prototype.getSpecs = function() {
return this.specs;
jasmine.Suite.prototype.specs = function() {
return this.specs_;
};
jasmine.Suite.prototype.execute = function(onComplete) {