Trivial Reporter improvements, runner now returns specs()

This commit is contained in:
ragaskar
2009-10-15 18:58:52 -07:00
parent 35171c9222
commit 308d02f72f
23 changed files with 2249 additions and 2157 deletions

View File

@@ -13,11 +13,6 @@ describe("jasmine.Env", function() {
expect(env.nextSpecId()).toEqual(2);
});
it('nextSuiteId should return consecutive integers, starting at 0', function () {
expect(env.nextSuiteId()).toEqual(0);
expect(env.nextSuiteId()).toEqual(1);
expect(env.nextSuiteId()).toEqual(2);
});
});
describe("reporting", function() {
var fakeReporter;

View File

@@ -33,8 +33,8 @@ describe('RunnerTest', function() {
env.describe('suite 2', function () {
env.it('test 2-1', function() {
foo++;
this.expect(foo).toEqual(1);
foo++;
this.expect(foo).toEqual(1);
});
});
@@ -44,9 +44,40 @@ describe('RunnerTest', function() {
expect(runnerResults.totalCount).toEqual(3);
expect(runnerResults.passedCount).toEqual(3);
});
it('should provide all specs', function () {
var foo;
env.beforeEach(function () {
foo = 0;
});
env.describe('suite 1', function () {
env.it('test 1-1', function() {
foo++;
this.expect(foo).toEqual(1);
});
env.it('test 1-2', function() {
foo++;
this.expect(foo).toEqual(1);
});
});
env.describe('suite 2', function () {
env.it('test 2-1', function() {
foo++;
this.expect(foo).toEqual(1);
});
});
env.currentRunner().execute();
expect(env.currentRunner().specs().length).toEqual(3);
});
});
describe('afterEach', function() {
describe('afterEach', function() {
it('should run after each spec for all suites', function () {
var foo = 3;
env.afterEach(function () {
@@ -64,7 +95,7 @@ describe('RunnerTest', function() {
env.describe('suite 2', function () {
env.it('test 2-1', function() {
this.expect(foo).toEqual(1);
this.expect(foo).toEqual(1);
});
});