Function mockall::predicate::str::starts_with

source ·
pub fn starts_with<P>(pattern: P) -> StartsWithPredicate
where P: Into<String>,
Expand description

Creates a new Predicate that ensures a str starts with pattern

§Examples

use predicates::prelude::*;

let predicate_fn = predicate::str::starts_with("Hello");
assert_eq!(true, predicate_fn.eval("Hello World"));
assert_eq!(false, predicate_fn.eval("Goodbye World"));