dwf/cj: added function and tests to get a suite's spec count

This commit is contained in:
pivotal
2009-08-27 14:21:10 -07:00
parent 7edeb13be8
commit 187bde37ca
4 changed files with 88 additions and 14 deletions

View File

@@ -8,7 +8,7 @@
* @param {jasmine.Suite} parentSuite
*/
jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
var self = this;
var self = this;
self.id = env.nextSuiteId_++;
self.description = description;
self.queue = new jasmine.Queue(env);
@@ -19,7 +19,6 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
self.specs = [];
};
jasmine.Suite.prototype.getFullName = function() {
var fullName = this.description;
for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
@@ -52,14 +51,19 @@ jasmine.Suite.prototype.getResults = function() {
jasmine.Suite.prototype.add = function(block) {
if (block instanceof jasmine.Suite) {
this.env.currentRunner.addSuite(block);
}
this.env.currentRunner.addSuite(block);
}
this.specs.push(block);
this.queue.add(block);
};
jasmine.Suite.prototype.execute = function(onComplete) {
var self = this;
this.queue.start(function () { self.finish(onComplete); });
jasmine.Suite.prototype.specCount = function(block) {
return this.specs.length;
};
jasmine.Suite.prototype.execute = function(onComplete) {
var self = this;
this.queue.start(function () {
self.finish(onComplete);
});
};