minor runner test cleanup

This commit is contained in:
ragaskar 2009-08-08 08:53:15 -07:00
parent 56c26c5b55
commit 0061054aaa
4 changed files with 9 additions and 7 deletions

View File

@ -1337,7 +1337,7 @@ jasmine.NestedResults.prototype.addResult = function(result) {
*/ */
jasmine.NestedResults.prototype.passed = function() { jasmine.NestedResults.prototype.passed = function() {
return this.passedCount === this.totalCount; return this.passedCount === this.totalCount;
} };
/** /**
* Base class for pretty printing for expectation results. * Base class for pretty printing for expectation results.
*/ */
@ -1582,7 +1582,6 @@ jasmine.Runner.prototype.finishCallback = function() {
jasmine.Runner.prototype.getResults = function() { jasmine.Runner.prototype.getResults = function() {
var results = new jasmine.NestedResults(); var results = new jasmine.NestedResults();
for (var i = 0; i < this.suites.length; i++) { for (var i = 0; i < this.suites.length; i++) {
//TODO: FIX
results.rollupCounts(this.suites[i].getResults()[0]); results.rollupCounts(this.suites[i].getResults()[0]);
} }
return results; return results;

View File

@ -40,11 +40,15 @@ describe('RunnerTest', function() {
env.currentRunner.execute(); env.currentRunner.execute();
expect(env.currentRunner.suites.length).toEqual(2); // "Runner expected two suites, got " + env.currentRunner.suites.length); var runnerResults = env.currentRunner.getResults();
expect(env.currentRunner.suites[0].getResults()[0].passed()).toEqual(true); //"Runner should have run specs in first suite"); console.error('runnerResults', runnerResults)
expect(env.currentRunner.suites[1].getResults()[0].passed()).toEqual(false); //"Runner should have run specs in second suite"); expect(runnerResults.totalCount).toEqual(2);
expect(runnerResults.passedCount).toEqual(1);
expect(runnerResults.failedCount).toEqual(1);
}); });
it('should ignore suites that have been x\'d', function() { it('should ignore suites that have been x\'d', function() {
env.xdescribe('one suite description', function () { env.xdescribe('one suite description', function () {
env.it('should be a test', function() { env.it('should be a test', function() {

View File

@ -77,4 +77,4 @@ jasmine.NestedResults.prototype.addResult = function(result) {
*/ */
jasmine.NestedResults.prototype.passed = function() { jasmine.NestedResults.prototype.passed = function() {
return this.passedCount === this.totalCount; return this.passedCount === this.totalCount;
} };

View File

@ -25,7 +25,6 @@ jasmine.Runner.prototype.finishCallback = function() {
jasmine.Runner.prototype.getResults = function() { jasmine.Runner.prototype.getResults = function() {
var results = new jasmine.NestedResults(); var results = new jasmine.NestedResults();
for (var i = 0; i < this.suites.length; i++) { for (var i = 0; i < this.suites.length; i++) {
//TODO: FIX
results.rollupCounts(this.suites[i].getResults()[0]); results.rollupCounts(this.suites[i].getResults()[0]);
} }
return results; return results;