Highlights
New Features
- Introduce the
require
dsl. This throws an error (aRequireError
, or a custom one) if the matcher used with it fails. If the matcher doesn't fail, then the require dsl will return the result of the expression.- For example,
try require([1, 2, 3]).to(haveCount(3))
will return[1, 2, 3]
. Howevertry require(2).toEqual(1))
will throw aRequireError
. - When the matcher fails,
require
will still register the assertion failure with XCTest. - This also adds
unwrap
andpollUnwrap
, which are work astry require(...).toNot(beNil())
andtry require(...).toEventuallyNot(beNil())
. With both sync and async variants. They either throw, or return non-optional versions of the expression. - See the documentation here for more.
- For example,
Deprecations
- Removes
Expectation.onFailure
, as the newrequire
dsl entirely replaces that API. This deprecation will persist through Nimble 14, before being marked as removed in Nimble 15 and fully removed in Nimble 16.
Breaking Changes
- The
throwAssertion
matcher no longer supports watchOS and tvOS in the cocoapods distribution of Nimble. This is because Nimble no longer directly embeds the CwlCatchException CwlPreconditionTesting libraries used in that matcher and instead Nimble pulls in those libraries transitively through the package manager used.
Automated Release Notes
What's Changed
- Bump cocoapods from 1.13.0 to 1.14.2 by @dependabot in #1094
- Introduce the require dsl. For when you need the assertion to pass before continuing by @younata in #1103
- Pull in CwlCatchException and CwlPreconditionTesting transitively. by @younata in #1108
Full Changelog: v13.0.0...v13.1.0