Function mockall::predicate::never

source ·
pub fn never() -> BooleanPredicate
Expand description

Creates a new Predicate that always returns false.

§Examples

use predicates::prelude::*;

let predicate_fn = predicate::never();
assert_eq!(false, predicate_fn.eval(&5));
assert_eq!(false, predicate_fn.eval(&10));
assert_eq!(false, predicate_fn.eval(&15));
// Won't work - Predicates can only operate on a single type
// assert_eq!(false, predicate_fn.eval("hello"))