| Index: third_party/pkg/angular/test/io/template_cache_generator_spec.dart
|
| diff --git a/third_party/pkg/angular/test/io/template_cache_generator_spec.dart b/third_party/pkg/angular/test/io/template_cache_generator_spec.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1b46ae90c518dd780464bc325ab6b42a18386cab
|
| --- /dev/null
|
| +++ b/third_party/pkg/angular/test/io/template_cache_generator_spec.dart
|
| @@ -0,0 +1,36 @@
|
| +library ng.tool.template_cache_generator_spec;
|
| +
|
| +import 'dart:async';
|
| +import 'dart:io';
|
| +
|
| +import 'package:angular/tools/template_cache_generator.dart' as generator;
|
| +import '../jasmine_syntax.dart';
|
| +import 'package:unittest/unittest.dart';
|
| +
|
| +main() => describe('template_cache_generator', () {
|
| + it('should correctly generate the templates cache file', () {
|
| + var tmpDir = Directory.systemTemp.createTempSync();
|
| + Future flush;
|
| + try {
|
| + flush = generator.main(['test/io/test_files/templates/main.dart',
|
| + '${tmpDir.path}/generated.dart', 'generated', '%SYSTEM_PACKAGE_ROOT%',
|
| + 'test/io/test_files,rewritten', 'MyComponent3']);
|
| + } catch(_) {
|
| + tmpDir.deleteSync(recursive: true);
|
| + rethrow;
|
| + }
|
| + return flush.then((_) {
|
| + expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(),
|
| + '// GENERATED, DO NOT EDIT!\n'
|
| + 'library generated;\n'
|
| + '\n'
|
| + 'import \'package:angular/angular.dart\';\n'
|
| + '\n'
|
| + 'primeTemplateCache(TemplateCache tc) {\n'
|
| + 'tc.put("rewritten/templates/main.html", new HttpResponse(200, r"""Hello World!"""));\n'
|
| + '}');
|
| + }).whenComplete(() {
|
| + tmpDir.deleteSync(recursive: true);
|
| + });
|
| + });
|
| +});
|
|
|