mockiato 0.9.6

A strict, yet friendly mocking library for Rust 2018
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use mockiato::mockable;
use std::io::{self, Write};

#[mockable(remote)]
trait Write {
    fn write(&mut self, buf: &[u8]) -> io::Result<usize>;

    fn flush(&mut self) -> io::Result<()>;
}

#[test]
fn remote_trait() {
    let write_mock = WriteMock::new();
    let _assert_implements_io_write: &dyn io::Write = &write_mock;
}