#assert #fixture #filesystem #fixtures #test

dev assert_fs

Filesystem fixtures and assertions for testing

31 releases (16 stable)

1.1.1 Jan 12, 2024
1.1.0 Dec 27, 2023
1.0.13 Apr 13, 2023
1.0.12 Mar 16, 2023
0.3.0 Jun 27, 2018

#5 in Testing

Download history 50727/week @ 2023-12-23 62030/week @ 2023-12-30 59458/week @ 2024-01-06 73221/week @ 2024-01-13 72147/week @ 2024-01-20 75847/week @ 2024-01-27 78274/week @ 2024-02-03 74916/week @ 2024-02-10 71570/week @ 2024-02-17 66505/week @ 2024-02-24 73586/week @ 2024-03-02 75995/week @ 2024-03-09 77337/week @ 2024-03-16 76792/week @ 2024-03-23 78707/week @ 2024-03-30 64830/week @ 2024-04-06

308,510 downloads per month
Used in 356 crates (344 directly)

MIT/Apache

52KB
850 lines

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.

Dependencies

~6–18MB
~213K SLoC