| OLD | NEW |
| (Empty) | |
| 1 library ng.tool.expression_extractor_spec; |
| 2 |
| 3 import 'package:di/di.dart'; |
| 4 import 'package:di/dynamic_injector.dart'; |
| 5 import 'package:angular/tools/common.dart'; |
| 6 import 'package:angular/tools/io.dart'; |
| 7 import 'package:angular/tools/io_impl.dart'; |
| 8 import 'package:angular/tools/source_crawler_impl.dart'; |
| 9 import 'package:angular/tools/html_extractor.dart'; |
| 10 import 'package:angular/tools/source_metadata_extractor.dart'; |
| 11 import '../jasmine_syntax.dart'; |
| 12 import 'package:unittest/unittest.dart'; |
| 13 |
| 14 main() => describe('expression_extractor', () { |
| 15 it('should extract all expressions from source and templates', () { |
| 16 Module module = new Module(); |
| 17 |
| 18 Injector injector = new DynamicInjector(modules: [module], |
| 19 allowImplicitInjection: true); |
| 20 |
| 21 IoService ioService = new IoServiceImpl(); |
| 22 var sourceCrawler = new SourceCrawlerImpl(['packages/']); |
| 23 var sourceMetadataExtractor = new SourceMetadataExtractor(sourceCrawler); |
| 24 List<DirectiveInfo> directives = |
| 25 sourceMetadataExtractor |
| 26 .gatherDirectiveInfo('test/io/test_files/main.dart'); |
| 27 var htmlExtractor = new HtmlExpressionExtractor(directives, ioService); |
| 28 htmlExtractor.crawl('test/io/test_files/'); |
| 29 |
| 30 var expressions = htmlExtractor.expressions; |
| 31 expect(expressions, unorderedEquals([ |
| 32 'ctrl.expr', |
| 33 'ctrl.anotherExpression', |
| 34 'ctrl.callback', |
| 35 'ctrl.twoWayStuff', |
| 36 'attr', |
| 37 'expr', |
| 38 'anotherExpression', |
| 39 'callback', |
| 40 'twoWayStuff', |
| 41 'exported + expression', |
| 42 'ctrl.inline.template.expression', |
| 43 'ngIfCondition', |
| 44 'ctrl.if' |
| 45 ])); |
| 46 }); |
| 47 }); |
| OLD | NEW |