mry 0.7.1

A simple but powerful mocking library that supports struct, trait, and function.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[mry::mry]
#[async_trait::async_trait]
pub trait Cat {
    async fn meow(&self, count: usize) -> &'static str;
}

#[async_std::test]
async fn meow_called() {
    let mut cat = MockCat::default();

    cat.mock_meow(2).returns("Called");

    assert_eq!(cat.meow(2).await, "Called");
}