1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Filesystem fixtures and assertions for testing.
//!
//! ```toml
//! [dependencies]
//! assert_fs = "0.2"
//! ```
//!
//! ## Example
//!
//! Here is a trivial example:
//!
//! ```rust,ignore
//! 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(predicate::path::exists());
//! temp.child("bar.txt").assert(predicate::path::missing());
//! temp.close().unwrap();
//! ```

#![warn(missing_docs)]

extern crate failure;
extern crate globwalk;
extern crate predicates;
extern crate tempfile;

mod assert;
pub use assert::*;

mod fs;
pub use fs::*;

mod errors;
pub use errors::FixtureError;

/// Extension traits that are useful to have available.
pub mod prelude {
    pub use assert::TempDirAssertExt;
    pub use fs::ChildPathTouchExt;
    pub use fs::ChildPathWriteBinExt;
    pub use fs::ChildPathWriteStrExt;
    pub use fs::TempDirChildExt;
    pub use fs::TempDirCopyExt;
}