Mocking framework for Rust (currently only nightly). See documentation for more.
#[mockable]mod hello_world {pubfnworld() -> &'staticstr{"world"}pubfnhello_world() -> String{format!("Hello {}!", world())}}#[test]fnmock_test(){
hello_world::world.mock_safe(|| MockResult::Return("mocking"));assert_eq!("Hello mocking!", hello_world::hello_world());}