Add versioning to jasmine

This commit is contained in:
ragaskar
2009-08-20 22:16:14 -07:00
parent 9b9a4b6835
commit 3993969c41
6 changed files with 73 additions and 7 deletions

View File

@@ -512,6 +512,13 @@ jasmine.include = function(url, opt_global) {
return eval(xhr.responseText);
}
};
jasmine.version_= {
"major": 0,
"minor": 9,
"build": 0,
"revision": 0
};
/**
* @namespace
*/
@@ -601,6 +608,17 @@ jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
jasmine.Env.prototype.setInterval = jasmine.setInterval;
jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
jasmine.Env.prototype.version = function () {
if (jasmine.version_) {
return parseInt(jasmine.version_.major + "" +
jasmine.version_.minor + "" +
jasmine.version_.build + "" +
jasmine.version_.revision + "");
} else {
return 0;
}
};
/**
* Register a reporter to receive status updates from Jasmine.
* @param {jasmine.Reporter} reporter An object which will receive status updates.
@@ -799,8 +817,7 @@ jasmine.Block = function(env, func, spec) {
this.spec = spec;
};
jasmine.Block.prototype.execute = function(onComplete) {
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
jasmine.Block.prototype.execute = function(onComplete) {
try {
this.func.apply(this.spec);
} catch (e) {
@@ -1651,6 +1668,7 @@ jasmine.Spec.prototype.execute = function(onComplete) {
spec.finish(onComplete);
return;
}
this.env.reporter.log('>> Jasmine Running ' + this.suite.description + ' ' + this.description + '...');
spec.env.currentSpec = spec;
spec.env.currentlyRunningTests = true;