CodeSandwich / Mocktopus

Mocking framework for Rust
MIT License
233 stars 20 forks source link

Try switching to Guerrilla as function injector #30

Closed CodeSandwich closed 5 years ago

CodeSandwich commented 5 years ago

https://github.com/mehcode/guerrilla

Gerschtli commented 5 years ago

Had a look into that crate and to realize, it does not provide thread safety at the moment. Tracking issue: https://github.com/mehcode/guerrilla/issues/10

CodeSandwich commented 5 years ago

It could be solved like in Mockito: mocking anything silently obtains a mutex making tests using them run non-parallel.

But there is an even worse problem: patching temporarily destroys patched function. I don't have any idea how to implement behavior on MockResult::Continue.