pub fn with_mock<F, R, T>(function_name: &str, mock_fn: F, test_fn: T) -> RExpand description
Run a function with a temporary mock
Automatically restores the original function after execution.
ยงExample
use windjammer_runtime::mock_function::with_mock;
fn get_time() -> i64 { 0 } // Simplified
with_mock("get_time", || 12345i64, || {
// Mock is active here
// let time = get_time();
// assert_eq!(time, 12345);
});
// Mock is automatically cleared