kxio 1.1.2

Provides injectable Filesystem and Network resources to make code more testable
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
type TestResult = Result<(), Box<dyn std::error::Error>>;

#[test]
fn write_read_file_exists() -> TestResult {
    let fs = crate::filesystem::temp()?;
    let pathbuf = fs.write_file("foo", "content")?;
    let c = fs.read_file("foo")?;
    assert_eq!(c, "content");
    assert!(fs.file_exists(&pathbuf));

    Ok(())
}