assert_fs

Crates.ioassert_fs
lib.rsassert_fs
version1.1.1
sourcesrc
created_at2018-05-28 11:20:10.287678
updated_at2024-01-12 02:58:36.288381
descriptionFilesystem fixtures and assertions for testing.
homepagehttps://github.com/assert-rs/assert_fs
repositoryhttps://github.com/assert-rs/assert_fs.git
max_upload_size
id67443
size76,232
Maintainers (github:rust-cli:maintainers)

documentation

http://docs.rs/assert_fs/

README

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.

Commit count: 304

cargo fmt