swift-spyable
swift-spyable copied to clipboard
Spy on protocol that confirms another protocol
Is your feature request related to a problem? Please describe.
When using @Spyable
macro on protocol that confirms another protocol, there is no additional methods of confirmed protocol, which leads to compilation error. Eg:
protocol A {
func a()
}
@Spyable
protocol B: A {
func b()
}
class BSpy: B {
var bCallsCount = 0
var bCalled: Bool {
return bCallsCount > 0
}
var bClosure: (() -> Void)?
func b() {
bCallsCount += 1
bClosure?()
}
}
Describe the solution you'd like Would be great to have confirmed protocol methods in Spy class