dwf/cj: added function and tests to get a suite's spec count
This commit is contained in:
18
src/Suite.js
18
src/Suite.js
@@ -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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user