Skip to content

Filesystem fixtures and assertions.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

assert-rs/assert_fs

Folders and files

NameName
Last commit message
Last commit date
Apr 3, 2025
Apr 26, 2024
Dec 2, 2024
Feb 2, 2021
Apr 26, 2024
Oct 3, 2022
Oct 26, 2023
Jul 25, 2024
Dec 2, 2024
Apr 1, 2025
Dec 2, 2024
May 28, 2018
Mar 29, 2023
Oct 5, 2023
Dec 1, 2022
May 29, 2024
Mar 29, 2023

Repository files navigation

assert_fs

Assert Filesystems - Filesystem fixtures and assertions for testing.

Documentation License Crates Status

assert_fs aims to simplify

  • Setting up files for your tests to consume
  • Asserting on files produced by your tests

Example

Here is a trivial example:

use assert_fs::prelude::*;
use predicates::prelude::*;

let temp = assert_fs::TempDir::new().unwrap();
let input_file = temp.child("foo.txt");
input_file.touch().unwrap();
// ... do something with input_file ...
input_file.assert("");
temp.child("bar.txt").assert(predicate::path::missing());
temp.close().unwrap();

See the documentation for more information.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.