Last change
on this file since 19:ab5f65372038 was 19:ab5f65372038, checked in by Borja Lopez <borja@…>, 9 years ago |
Imported latest envjasmine version, the initial import from darcs had the wrong version
|
File size:
605 bytes
|
Rev | Line | |
---|
[19] | 1 | EnvJasmine.load(EnvJasmine.jsDir + "callbackDemo.js");
|
---|
| 2 |
|
---|
| 3 | describe('runIfTrevor', function () {
|
---|
| 4 | it('calls callback if Trevor', function () {
|
---|
| 5 | var callback = jasmine.createSpy();
|
---|
| 6 |
|
---|
| 7 | NS.runIfTrevor('Trevor', callback);
|
---|
| 8 | expect(callback).toHaveBeenCalledWith('Trevor');
|
---|
| 9 | });
|
---|
| 10 |
|
---|
| 11 | it('throws an error and does not call callback if not Trevor', function () {
|
---|
| 12 | var callback = jasmine.createSpy();
|
---|
| 13 |
|
---|
| 14 | expect(function () {
|
---|
| 15 | NS.runIfTrevor('Orson', callback);
|
---|
| 16 | }).toThrow('You aren\'t Trevor!');
|
---|
| 17 |
|
---|
| 18 | expect(callback).not.toHaveBeenCalled();
|
---|
| 19 | });
|
---|
| 20 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.