Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.81k stars 601 forks source link

Add a matcher to negate a passed in matcher #1151

Closed younata closed 3 months ago

younata commented 3 months ago

This adds a new matcher that inverts the passed-in matcher.

This matcher is really useful when you're working with matchers taking in other matchers, such as allPass, map, satisfyAllOf, satisfyAnyOf and so on.

Future work would be to refactor how Expectation, AsyncExpectation, Requirement, AsyncRequiment such that toNot/notTo are syntax sugar for to(not(...)). But that's a larger refactor than I want to do for this PR.

fixes #1150

Checklist - While not every PR needs it, new features should consider this list: