Hi, I'm trying to write my own matcher to catch a specific error. The doco talks about a Matcher but that won't resolve so I looked at the code for .throwsError(...) and based a very simple one on using a Predicate like this:
But I've been having all sorts of issues trying to get this to work. Currently for example, it's executing the expect expression twice and I cannot get it to output any of the custom messages I try and write. But when I look through the code in Nimbles matchers I can't see what I've done wrong.
Any suggestions? And is there any documentation on writing predicate matchers?
Hi, I'm trying to write my own matcher to catch a specific error. The doco talks about a
Matcher
but that won't resolve so I looked at the code for.throwsError(...)
and based a very simple one on using aPredicate
like this:But I've been having all sorts of issues trying to get this to work. Currently for example, it's executing the expect expression twice and I cannot get it to output any of the custom messages I try and write. But when I look through the code in Nimbles matchers I can't see what I've done wrong.
Any suggestions? And is there any documentation on writing predicate matchers?