Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 174 forks source link

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

Open ziilive opened 6 months ago

ziilive commented 6 months 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 5 months 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.