Partial spies
Pre-release
Pre-release
- Adds more logging around SourceKit errors
- Adds a new test double - "partial spy"
What is a partial spy?
Partial spies are spies which can also forward calls to the original implementation.
E.g.
class MyClass {
func myMethod() {
print("original implementation")
}
}
class MyClassPartialSpy: MyClass {
... // generated partial spy
}
let mySpy = MyClassPartialSpy()
mySpy.myMethod() // does not print "original implementation"
mySpy.forwardToOriginalMyMethod = true
mySpy.myMethod() // prints "original implementation"