Re-refactored Queue to use straightforward callbacks

This commit is contained in:
ragaskar
2009-08-03 22:22:13 -07:00
parent 9475de28b3
commit 0d6c6c2a35
8 changed files with 47 additions and 72 deletions

View File

@@ -12,18 +12,14 @@ jasmine.Block = function(env, func, spec) {
this.spec = spec;
};
jasmine.Block.prototype._next = function() {
this.spec.finish(); // default value is to be done after one function
};
jasmine.Block.prototype.execute = function() {
jasmine.Block.prototype.execute = function(onComplete) {
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
try {
this.func.apply(this.spec);
} catch (e) {
this.fail(e);
}
this._next();
onComplete();
};
jasmine.Block.prototype.fail = function(e) {