How to mock a static function on an external struct using `mockall` (or something else)?

Hi all!

I have an external struct ExternalStruct with a static function with_smt(smt: &str) -> Self, it also has a couple of non static functions. I would like to test a function that calls ExternalStruct::with_smt(&smt) and the non static functions. The function ExternalStruct::with_smt() would fail during testing since it requires access to some hardware, so I need to mock the whole of ExternalStruct.

I've been trying to figure out how to use mockall to do this but haven't been able to do so... Could someone please help me out here? Thank you!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.