Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add matchers for Result that match against submatchers, or for equatable values. #1134

Merged
merged 2 commits into from
Mar 30, 2024

Conversation

younata
Copy link
Member

@younata younata commented Mar 29, 2024

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.

New feature: Minor version bump required!

@younata younata merged commit 307cdcd into main Mar 30, 2024
15 checks passed
@younata younata deleted the BeResult_with_matchers branch March 30, 2024 00:31
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Apr 9, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [Quick/Nimble](https://togithub.com/Quick/Nimble) | minor | `from:
"13.2.1"` -> `from: "13.3.0"` |

---

### Release Notes

<details>
<summary>Quick/Nimble (Quick/Nimble)</summary>

### [`v13.3.0`](https://togithub.com/Quick/Nimble/releases/tag/v13.3.0)

[Compare
Source](https://togithub.com/Quick/Nimble/compare/v13.2.1...v13.3.0)

### Highlights

- Adds Matchers for Result that match against submatchers or equatable
values.
-   Use DocC for documentation.
-   Make `PollingDefaults` threadsafe.

#### What's Changed

- Make PollingDefaults threadsafe by
[@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1122](https://togithub.com/Quick/Nimble/pull/1122)
- Bump softprops/action-gh-release from 1 to 2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/Quick/Nimble/pull/1128](https://togithub.com/Quick/Nimble/pull/1128)
- Depend on CwlPreconditionTesting 2.2.0 for Cocoapods by
[@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1129](https://togithub.com/Quick/Nimble/pull/1129)
- Add matchers for Result that match against submatchers, or for
equatable values. by [@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1134](https://togithub.com/Quick/Nimble/pull/1134)
- Use docc for documentation, instead of having it all in a single,
giant README. by [@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1135](https://togithub.com/Quick/Nimble/pull/1135)
- Get documentation deploying working. by
[@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1136](https://togithub.com/Quick/Nimble/pull/1136)
- Improve documentation articles by adding short abstracts to them. by
[@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1137](https://togithub.com/Quick/Nimble/pull/1137)
- Fix a typo in the name of this framework. 🤦🏻‍♀️ by
[@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Nimble/pull/1138](https://togithub.com/Quick/Nimble/pull/1138)
- Bump actions/checkout from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/Quick/Nimble/pull/1139](https://togithub.com/Quick/Nimble/pull/1139)

**Full Changelog**:
Quick/Nimble@v13.2.1...v13.3.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
noamfreeman pushed a commit to noamfreeman/Nimble that referenced this pull request Oct 14, 2024
…ble values. (Quick#1134)

* Add matchers for Result that match against submatchers, or for equatable values.

* Add documentation for the new matchers for result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant