Test that afterEach is called after a failing spec.

This commit is contained in:
John Firebaugh
2010-09-29 08:19:43 -07:00
parent 60a5d60f42
commit a8b0a0ee4f

View File

@@ -105,6 +105,19 @@ describe('RunnerTest', function() {
expect(runnerResults.totalCount).toEqual(3);
expect(runnerResults.passedCount).toEqual(3);
});
it('should run after a failing spec', function () {
var afterEach = jasmine.createSpy();
env.afterEach(afterEach);
env.describe('suite', function () {
env.it('fails', function () {
this.explodes();
});
}).execute();
expect(afterEach).toHaveBeenCalled();
});
});