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.03k stars 104 forks source link

SwiftyMocky will NOT generate Mock, adopting all methods/properties gathered from all inherited protocols when the other protocols are defined in different frameworks #301

Open KaBlaize opened 2 years ago

KaBlaize commented 2 years ago

Based on the example it should just work and based on the swiftymocky doctor command output everything is just fine (version: v4.1.0) .

But I get the following error when try to run my tests: "Type 'AppCoordinatorProtocolMock' does not conform to protocol 'Coordinator'"

Where Coordinator protocol is defined in a different project/framework.

Mockfile contains the other module's definition.

Any help is appropriated. Thanks, Balazs

mpdifran commented 2 years ago

I'm having the same issue in my project.

KaBlaize commented 2 years ago

Hello @iliaskarim @SiarheiFedartsou @glyuck , Please let me know if you need any assistance with this.
In case you don't have the time/reason to do it where can I start to look if I want it check/fix/add it?

ofc, after reading Contributing

Regards and thanks for your great work, Balazs

VilemKurz commented 2 years ago

It works. You have to:

  1. make sure all super protocols are annotated by // sourcery: AutoMockable
  2. add path to files in the other target in your mockfile, in sources