assert_fs 1.1.3

Filesystem fixtures and assertions for testing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(clippy::unwrap_used)]

use assert_fs::prelude::*;

fn main() {
    let temp = assert_fs::TempDir::new().unwrap();
    let input_file = temp.child("foo.txt");

    input_file.write_str("Hello\nWorld!").unwrap();

    input_file.assert("Goodbye\nWorld!");

    temp.close().unwrap();
}