predicates::path

Function eq_file

Source
pub fn eq_file<P: Into<PathBuf>>(path: P) -> BinaryFilePredicate
Expand description

Creates a new Predicate that ensures complete equality

ยงExamples

use std::path::Path;
use predicates::prelude::*;

let predicate_file = predicate::path::eq_file(Path::new("Cargo.toml"));
assert_eq!(true, predicate_file.eval(Path::new("Cargo.toml")));
assert_eq!(false, predicate_file.eval(Path::new("src")));
assert_eq!(false, predicate_file.eval(Path::new("src")));