Add doc about Spec#after() method.

This commit is contained in:
Christian Williams 2010-03-05 22:10:05 -05:00
parent 22e9434a50
commit 2ab6af1e48
1 changed files with 13 additions and 0 deletions

View File

@ -251,6 +251,19 @@ A runner can also have an afterEach declarations. Runner afterEach functions are
};
});
### Single-spec After functions
A spec may ask Jasmine to execute some code after the spec has finished running; the code will run whether the spec finishes successfully or not. Multiple after functions may be given.
describe('some suite', function () {
it(function () {
var originalTitle = window.title;
this.after(function() { window.title = originalTitle; });
MyWindow.setTitle("new value");
expect(window.title).toEqual("new value");
});
### Nested Describes
Jasmine supports nested describes. An example: