Macro pact_consumer::like [−][src]
macro_rules! like {
($($json_pattern : tt) +) => { ... };
}
Expand description
Generates the specified value, matches any value of the same data type. This
is intended for use inside json_pattern!
, and it interprets its arguments
as a json_pattern!
.
use pact_consumer::*;
json_pattern!({
"id": like!(10),
"metadata": like!({}),
});
If you’re building StringPattern
values, you’ll need to call
Like::new
manually instead.