OLD | NEW |
(Empty) | |
| 1 library jasmine_syntax_spec; |
| 2 |
| 3 import 'jasmine_syntax.dart'; |
| 4 import 'package:unittest/unittest.dart' as unit; |
| 5 |
| 6 main() { |
| 7 describe('jasmine syntax', () { |
| 8 describe('beforeEach priority', () { |
| 9 var log = []; |
| 10 beforeEach(() { |
| 11 log.add("first p0"); |
| 12 }); |
| 13 |
| 14 beforeEach(() { |
| 15 log.add("p0"); |
| 16 }, priority: 0); |
| 17 |
| 18 beforeEach(() { |
| 19 log.add("p1"); |
| 20 }, priority: 1); |
| 21 |
| 22 it('should call beforeEach in the correct order', () { |
| 23 unit.expect(log.join(';'), unit.equals('p1;first p0;p0')); |
| 24 }); |
| 25 }); |
| 26 |
| 27 describe('beforeEach priority with nested describes', () { |
| 28 var log; |
| 29 beforeEach(() { |
| 30 log = []; |
| 31 }, priority: 2); |
| 32 |
| 33 beforeEach(() { |
| 34 log.add("p0Outer"); |
| 35 }, priority: 0); |
| 36 |
| 37 beforeEach(() { |
| 38 log.add("p1Outer"); |
| 39 }, priority: 1); |
| 40 |
| 41 it('should call beforeEach in the correct order', () { |
| 42 unit.expect(log.join(';'), unit.equals('p1Outer;p0Outer')); |
| 43 }); |
| 44 |
| 45 describe('inner', () { |
| 46 beforeEach(() { |
| 47 log.add("p0Inner"); |
| 48 }, priority: 0); |
| 49 |
| 50 beforeEach(() { |
| 51 log.add("p1Inner"); |
| 52 }, priority: 1); |
| 53 |
| 54 |
| 55 it('should call beforeEach in the correct order', () { |
| 56 unit.expect(log.join(';'), unit.equals('p1Outer;p1Inner;p0Outer;p0Inne
r')); |
| 57 }); |
| 58 }); |
| 59 |
| 60 |
| 61 }); |
| 62 }); |
| 63 } |
OLD | NEW |