Index: third_party/pkg/angular/test/core/registry_spec.dart |
diff --git a/third_party/pkg/angular/test/core/registry_spec.dart b/third_party/pkg/angular/test/core/registry_spec.dart |
index 532dbf1aeaa4e53f1bdbf8aa72919e0ae472d99f..f06241bf50c69dfbe45e93f9c9aa7680a875d305 100644 |
--- a/third_party/pkg/angular/test/core/registry_spec.dart |
+++ b/third_party/pkg/angular/test/core/registry_spec.dart |
@@ -1,46 +1,46 @@ |
library registry_spec; |
import '../_specs.dart'; |
+import 'package:angular/application_factory.dart'; |
-main() => describe('RegistryMap', () { |
- it('should allow for multiple registry keys to be added', () { |
- var module = new Module() |
- ..type(MyMap) |
- ..type(MetadataExtractor) |
- ..type(A1) |
- ..type(A2); |
+main() { |
+ describe('RegistryMap', () { |
+ it('should allow for multiple registry keys to be added', () { |
+ var module = new Module() |
+ ..type(MyMap) |
+ ..type(A1) |
+ ..type(A2); |
- var injector = new DynamicInjector(modules: [module]); |
- expect(() { |
- injector.get(MyMap); |
- }).not.toThrow(); |
- }); |
+ var injector = applicationFactory().addModule(module).createInjector(); |
+ expect(() { |
+ injector.get(MyMap); |
+ }).not.toThrow(); |
+ }); |
- it('should iterate over all types', () { |
- var module = new Module() |
- ..type(MyMap) |
- ..type(MetadataExtractor) |
- ..type(A1); |
+ it('should iterate over all types', () { |
+ var module = new Module() |
+ ..type(MyMap) |
+ ..type(A1); |
- var injector = new DynamicInjector(modules: [module]); |
- var keys = []; |
- var types = []; |
- var map = injector.get(MyMap); |
- map.forEach((k, t) { keys.add(k); types.add(t); }); |
- expect(keys).toEqual([new MyAnnotation('A'), new MyAnnotation('B')]); |
- expect(types).toEqual([A1, A1]); |
- }); |
+ var injector = applicationFactory().addModule(module).createInjector(); |
+ var keys = []; |
+ var types = []; |
+ var map = injector.get(MyMap); |
+ map.forEach((k, t) { keys.add(k); types.add(t); }); |
+ expect(keys).toEqual([new MyAnnotation('A'), new MyAnnotation('B')]); |
+ expect(types).toEqual([A1, A1]); |
+ }); |
- it('should safely ignore typedefs', () { |
- var module = new Module() |
- ..type(MyMap) |
- ..type(MetadataExtractor) |
- ..value(MyTypedef, (String _) => null); |
+ it('should safely ignore typedefs', () { |
+ var module = new Module() |
+ ..type(MyMap) |
+ ..value(MyTypedef, (String _) => null); |
- var injector = new DynamicInjector(modules: [module]); |
- expect(() => injector.get(MyMap), isNot(throws)); |
+ var injector = applicationFactory().addModule(module).createInjector(); |
+ expect(() => injector.get(MyMap), isNot(throws)); |
+ }); |
}); |
-}); |
+} |
typedef void MyTypedef(String arg); |
@@ -61,4 +61,4 @@ class MyAnnotation { |
} |
@MyAnnotation('A') @MyAnnotation('B') class A1 {} |
-@MyAnnotation('A') class A2 {} |
+@MyAnnotation('A') class A2 {} |