Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.65k stars 171 forks source link

How to stub a objc method with a `error:(NSError **)errPtr` parameter? #493

Open ziilive opened 1 month ago

ziilive commented 1 month ago

Objc method declare like:

- (BOOL)connectToHost:(NSString*)host onPort:(uint16_t)port error:(NSError **)errPtr;

Bridged to swift:

func connectTo(host: on port:) throws -> Bool

So how do stub a method like this?

MatyasKriz commented 1 month ago

Hey @ziilive, unfortunately I'm not really well-versed in the Obj-C mocking part, so I can't help here, perhaps someone from the community might know.