Closed joeftiger closed 1 year ago
1.0.2 now supports matching on text bodies:
let pact = PactBuilder::new("C", "P")
.interaction("I", "", |mut i| {
i.request.body_matching(term!("^(True|False)$", "True"));
i
})
.build()
When building an expecting response, it is currently only possible to define JSON patterns (afaik).
However, some apis may return a plain text boolean as in
True
orFalse
. I do not find a possibility to define a pattern for a text response, as the functionResponseBuilder::body()
accepts no patterns.I tried fiddling with
body_and_matching_rules_mut()
, but this wouldThe following does not work either as it returns the boolean encapsulated inside
"True"
or"False"
.It would be great when textual patterns could be implemented.