-
Notifications
You must be signed in to change notification settings - Fork 4
Feature: automatic injection #43
base: master
Are you sure you want to change the base?
Feature: automatic injection #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, I have only spotted couple text issue that can be fixed in other PR 👍
} | ||
``` | ||
|
||
This way when your class or struct is created via injector, shortly afterwards it receives `injectDependencies(injector:)` call. This is the place where you want to fetch your dependencies from `injector`, or dependencies are injected automatically (in case of `AutoInjectable`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing )
a the end.
injectCreatableObject = InjectCreatableClass(injector: injector) | ||
} | ||
|
||
it("should not have object conforming to protocol injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
expect(injectCreatableObject.objectConformingToProtocol).to(beIdenticalTo(objectConformingToProtocol)) | ||
} | ||
|
||
it("should not have empty swift object injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
injectCreatableObject = InjectCreatableClass(injector: injector) | ||
} | ||
|
||
it("should not have object conforming to protocol injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
expect(injectCreatableObject.emptySwiftObject).to(beIdenticalTo(emptySwiftObject)) | ||
} | ||
|
||
it("should have creatable object injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
injectCreatableObject = InjectCreatableClass(injector: injector) | ||
} | ||
|
||
it("should not have object conforming to protocol injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
expect(injectCreatableObject.objectConformingToProtocol).notTo(beNil()) | ||
} | ||
|
||
it("should not have empty swift object injected") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like either tests description is wrong or test, since they don't match
resolves #37
Injectable
protocol by addingCreatable
andInjectCreatable
protocols withinit()
andinit(injector: Injecting)
respectively