Trait faux::matcher::InvocationMatcher [−][src]
Expand description
Matcher for the invocation of a method.
Implementors provide an expectation for each method argument.
This trait is implemented for tuples of ArgMatcher
of up to ten
elements.
Examples
Simple
use faux::matcher::{self, InvocationMatcher};
let matcher = (matcher::eq(5), matcher::any());
assert!(matcher.matches(&(5, "hello")).is_ok());
assert!(matcher.matches(&(3, "hello")).is_err());
Single argument
use faux::matcher::{self, InvocationMatcher};
// note that single arg matchers are wrapped in a tuple
// don't forget the trailing comma to denote it is a tuple
let matcher = (matcher::eq(20),);
assert!(matcher.matches(&20).is_ok());