Mocktopus
Mocktopus copied to clipboard
Mocking framework for Rust
Generally speaking, safe operations have no suffix, while their unsafe counterparts have `_unchecked`, `_unsafe`, or `_raw` like `mock_raw` does. So, I think it would be more ergonomic to switch all...
``` error[E0434]: can't capture dynamic environment in a fn item --> mm2src/coins/eth.rs:2089:50 | 2089 | let mut existing_history = match self.load_history_from_file(ctx).compat().await { | ^^^^ | = help: use the `||...
Hi, for function to test like following: `````` fn handle_response(response:Response) { save_db(response.get_users()); let unread_count = read_unread_from_db(); send_push_notification(unread_count); } `````` I'd like to make sure send_push_notification did get called with the...
Take the following example: ```rust #[mockable] fn call_with_closure( num: u32, math_op: impl FnOnce(u32) -> u32, ) -> u32 { math_op(num) } ``` This fails with the following compilation error: ```shell...
Signed-off-by: Gregory Hill
I have 2 creates in my project, base and service, and service crate based on base. And the code is something like this: ``` crate base { db.rs #[mockable] fun...
Trying to mock an unsafe function results in an error. Is there any particular reason my unsafe function cannot be mocked? Minimal test: ``` unsafe fn count() -> i32 {...
Add feature of injecting all modules in a crate with a single line of code in root module: ```#![inject_mocks]``` Blocked: https://github.com/rust-lang/rust/issues/41430
``` #[mockable] mod module; ``` Doesn't make content of `module` mockable since rustc 1.30.0-nightly (63d51e89a 2018-09-28). The necessary functionality was removed from rustc, it may or may not be restored:...