1 min readNov 28, 2018
Hi Bartosz,
there is power in simplicity you introduce :)
I decide to try your way of stubbing methods and face with problem with methods with generics arguments.
Here is simple code:
protocol Screen {}protocol Navigator { func show<ScreenType: Screen>(_ screen: ScreenType) }final class NavigatorStub: Navigator { // MARK: - Stubs lazy var showStub = stub(of: show) // Generic parameter 'ScreenType' could not be inferred // MARK: - API func show<ScreenType: Screen>(_ screen: ScreenType) {
showStub(screen)
}}
Did you notice this use case?