#filesystem #test #assert #fixture

dev assert_fs

Filesystem fixtures and assertions for testing

16 releases (1 stable)

✓ Uses Rust 2018 edition

1.0.0 Mar 27, 2020
0.13.1 Dec 1, 2019
0.13.0 Nov 29, 2019
0.11.3 Jan 29, 2019
0.3.0 Jun 27, 2018

#49 in Testing

Download history 1221/week @ 2019-12-10 767/week @ 2019-12-17 422/week @ 2019-12-24 982/week @ 2019-12-31 807/week @ 2020-01-07 1093/week @ 2020-01-14 1833/week @ 2020-01-21 634/week @ 2020-01-28 642/week @ 2020-02-04 621/week @ 2020-02-11 481/week @ 2020-02-18 1191/week @ 2020-02-25 783/week @ 2020-03-03 405/week @ 2020-03-10 1035/week @ 2020-03-17 706/week @ 2020-03-24

3,683 downloads per month
Used in 27 crates

MIT/Apache

46KB
684 lines

assert_fs

Assert Filesystems - Filesystem fixtures and assertions for testing.

Build Status Documentation License Crates Status

assert_fs aims to simplify

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

Install

Add to your Cargo.toml:

[dependencies]
assert_fs = "1.0.0"

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

~4MB
~86K SLoC