Mock's function address approach doesn't work with Swift generics:
class MyMock<T>: Mock {
func doit(thing: T) {
invoke(doit, args: (thing))
}
}
class MyTestClass: MyMock<String> {}
class GenericTests: QuickSpec {
override func spec() {
describe("memory address") {
it("should be equal") {
let obj = MyTestClass()
obj.doit(thing: "")
let addr1 = obj.address(of: obj.doit)
let addr2 = obj.address(of: obj.doit) // Should be equal to addr1, is different
let inv = cl.invokations(of: cl.doit) // Should be 1, will be 0
}
}
}
}
Mock's function address approach doesn't work with Swift generics: