I find that the current matchers for Result, where you must pass in a closure to be checked against the success/failure values, to be rather cumbersome. I'd much rather pass in another matcher to do this check. I find that it reads much easier.
To that end, I added beSuccess that takes in a matcher, and beFailure that takes in a matcher.
For additional ease of use, I also added beSuccess that takes in an Equatable value, for when the success value is Equatable itself. This is similar to using beSuccess(equal(someValue)), but it also slightly improves the error message in that case.
I find that the current matchers for Result, where you must pass in a closure to be checked against the success/failure values, to be rather cumbersome. I'd much rather pass in another matcher to do this check. I find that it reads much easier.
To that end, I added
beSuccess
that takes in a matcher, andbeFailure
that takes in a matcher.For additional ease of use, I also added
beSuccess
that takes in an Equatable value, for when the success value is Equatable itself. This is similar to usingbeSuccess(equal(someValue))
, but it also slightly improves the error message in that case.New feature: Minor version bump required!