jasmine.Env should always have a reporter now, no need to check.

This commit is contained in:
Christian Williams 2009-07-08 18:01:05 -07:00
parent a6aa9c652b
commit 0c24c2df2e
6 changed files with 9 additions and 25 deletions

View File

@ -1519,9 +1519,7 @@ jasmine.QueuedFunction.prototype.next = function() {
};
jasmine.QueuedFunction.prototype.safeExecute = function() {
if (this.env.reporter) {
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
}
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
try {
this.func.apply(this.spec);
@ -1626,9 +1624,7 @@ jasmine.Runner = function(env) {
jasmine.util.inherit(jasmine.Runner, jasmine.ActionCollection);
jasmine.Runner.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportRunnerResults(this);
}
this.env.reporter.reportRunnerResults(this);
};
jasmine.Runner.prototype.getResults = function() {
@ -1743,9 +1739,7 @@ jasmine.Spec.prototype.resetTimeout = function() {
};
jasmine.Spec.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportSpecResults(this);
}
this.env.reporter.reportSpecResults(this);
};
jasmine.Spec.prototype.finish = function() {
@ -1873,9 +1867,7 @@ jasmine.Suite.prototype.getFullName = function() {
};
jasmine.Suite.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportSuiteResults(this);
}
this.env.reporter.reportSuiteResults(this);
};
jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {

View File

@ -143,7 +143,7 @@ describe('Spies', function () {
});
it('calls removeAllSpies during spec finish', function() {
var test = new jasmine.Spec({}, {}, 'sample test');
var test = new jasmine.Spec(new jasmine.Env(), {}, 'sample test');
this.spyOn(test, 'removeAllSpies');

View File

@ -24,9 +24,7 @@ jasmine.QueuedFunction.prototype.next = function() {
};
jasmine.QueuedFunction.prototype.safeExecute = function() {
if (this.env.reporter) {
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
}
this.env.reporter.log('>> Jasmine Running ' + this.spec.suite.description + ' ' + this.spec.description + '...');
try {
this.func.apply(this.spec);

View File

@ -12,9 +12,7 @@ jasmine.Runner = function(env) {
jasmine.util.inherit(jasmine.Runner, jasmine.ActionCollection);
jasmine.Runner.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportRunnerResults(this);
}
this.env.reporter.reportRunnerResults(this);
};
jasmine.Runner.prototype.getResults = function() {

View File

@ -103,9 +103,7 @@ jasmine.Spec.prototype.resetTimeout = function() {
};
jasmine.Spec.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportSpecResults(this);
}
this.env.reporter.reportSpecResults(this);
};
jasmine.Spec.prototype.finish = function() {

View File

@ -28,9 +28,7 @@ jasmine.Suite.prototype.getFullName = function() {
};
jasmine.Suite.prototype.finishCallback = function() {
if (this.env.reporter) {
this.env.reporter.reportSuiteResults(this);
}
this.env.reporter.reportSuiteResults(this);
};
jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {