Function predicates::prelude::predicate::path::is_file[][src]

pub fn is_file() -> FileTypePredicate

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")));