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

@@ -1743,7 +1743,7 @@ jasmine.Spec.prototype.removeAllSpies = function() {
* @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);
@@ -1754,7 +1754,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) {
@@ -1787,17 +1786,22 @@ 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);
});
};
jasmine.WaitsBlock = function(env, timeout, spec) {
this.timeout = timeout;
jasmine.Block.call(this, env, null, spec);