Trait assert_fs::assert::PathAssert [−][src]
pub trait PathAssert { fn assert<I, P>(&self, pred: I) -> &Self
where
I: IntoPathPredicate<P>,
P: Predicate<Path>; }
Assert the state of files within TempDir
.
Examples
ⓘThis example is not tested
use assert_fs::*; 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
predicates::prelude
for more predicates. - See
IntoPathPredicate
for other built-in conversions.
Required Methods
ⓘImportant traits for &'a mut R
fn assert<I, P>(&self, pred: I) -> &Self where
I: IntoPathPredicate<P>,
P: Predicate<Path>,
I: IntoPathPredicate<P>,
P: Predicate<Path>,
Wrap with an interface for that provides assertions on the TempDir
.