MakeAWishFoundation / SwiftyMocky

Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.
MIT License
1.04k stars 106 forks source link

No registered comparators for Optional #270

Closed bukira closed 3 years ago

bukira commented 3 years ago

I am trying to get comparators to work, they are working else where but not in one instance

I get

[FATAL] No registered comparators for Optional < CallRoute >

But I have done

Matcher.default.register(CallRoute.self) { (lhs, rhs) -> Bool in guard lhs.ID == rhs.ID else { return false } return true }

So I don't understand why it is saying its not registered

bukira commented 3 years ago

ok fixed it

needed to be

Matcher.default.register(CallRoute?.self) { (lhs, rhs) -> Bool in guard lhs?.ID == rhs?.ID else { return false } return true }