Closed oersted closed 1 year ago
Hey @oersted , this may be too hidden in the docs but have you looked at: https://docs.rs/faux/latest/faux/attr.methods.html#path
It allows you to specify the path to the struct you are trying to mock. Please let me know if this helps you. I can try to make a larger example to show how it works if that's helpful (:
@oersted are you still having an issue with mocking structs from separate modules?
Apologies for the late reply, this is exactly what I needed, thank you.
When a struct has complex functionality, it is not uncommon to have multiple
impl
blocks in multiple files to avoid having large files.Currently
#[faux::methods]
fails to compile withunresolved import super
, since it assumes that the faux struct will be directly in the same module (file) rather than a parent module.