refactor(reflector): cleanup

This commit is contained in:
vsavkin
2014-10-07 10:42:27 -04:00
parent 7d566adea0
commit 5162b3c0ca
3 changed files with 13 additions and 19 deletions

View File

@ -36,7 +36,7 @@ export function main() {
expect(p).toBeFuture();
});
it('should return a future if the binding is sync', function () {
it('should return a future when the binding is sync', function () {
var injector = new Injector([
SynchronousUserList
]);
@ -44,6 +44,14 @@ export function main() {
expect(p).toBeFuture();
});
it("should return a future when the binding is sync (from cache)", function () {
var injector = new Injector([
UserList
]);
expect(injector.get(UserList)).toBeAnInstanceOf(UserList);
expect(injector.asyncGet(UserList)).toBeFuture();
});
it('should return the injector', function (done) {
var injector = new Injector([]);
var p = injector.asyncGet(Injector);
@ -67,14 +75,6 @@ export function main() {
});
});
it("should return a future when the binding is sync from cache", function () {
var injector = new Injector([
UserList
]);
expect(injector.get(UserList)).toBeAnInstanceOf(UserList);
expect(injector.asyncGet(UserList)).toBeFuture();
});
it("should create only one instance (async + async)", function (done) {
var injector = new Injector([
bind(UserList).toAsyncFactory([], fetchUsers)