Function predicates::path::is_file
source · pub fn is_file() -> FileTypePredicate
Expand description
Creates a new Predicate
that ensures the path points to a file.
§Examples
use std::path::Path;
use predicates::prelude::*;
let predicate_fn = predicate::path::is_file();
assert_eq!(true, predicate_fn.eval(Path::new("Cargo.toml")));
assert_eq!(false, predicate_fn.eval(Path::new("src")));
assert_eq!(false, predicate_fn.eval(Path::new("non-existent-file.foo")));