Issue with Cuckoo Generating Mock for a variable's property
Description I'm encountering an issue when using Cuckoo to generate mocks for a property named currentCastedMedia within a protocol. The property is declared with the BehaviorRelay type, and it holds a tuple with several optional and non-optional elements.
Here's how the property is defined in the protocol:
var currentCastedMedia: BehaviorRelay<(streamURL: URL?, title: String, albumName: String, thumbnailURL: URL?, playAtTime: TimeInterval, mediaType: CastMediaType)?> { get }
And here's how it's implemented in the class conforming to the protocol:
var currentCastedMedia = BehaviorRelay<(streamURL: URL?, title: String, albumName: String, thumbnailURL: URL?, playAtTime: TimeInterval, mediaType: CastMediaType)?>(value: nil)
However, when Cuckoo generates mocks for this property, the generated code seems incomplete and not matching the property's declaration.
Here's a snippet of the generated code:
The generated code appears to be incomplete and not in alignment with the property's declaration in the protocol and class.
I've verified that the protocol and class implementation are correct, and the issue seems to be related to how Cuckoo handles this specific property.
Steps Taken:
- Verified the correctness of the protocol and class declarations.
- Manually added the incomplete property and cleared the Generate Cuckoo Mock in Build Phases so it won't change back the manually added fixes.
Expectation: I expect Cuckoo to generate mocks for the currentCastedMedia property in a way that accurately reflects the property's declaration in the protocol and class.
Any guidance or insights into this issue would be greatly appreciated.
Hey, seems like there's a bug in parsing the type, but to be frank, you should define a struct to use instead of a tuple with so many parameters. It should work fine when changed to BehaviorRelay<SongInfo?> should pass fine.
I'm pretty sure that your specific use-case is fixed in the version I'm working on, but it's not releasable yet.