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 Satisfy() matcher #437

Merged
merged 1 commit into from Apr 25, 2021
Merged

Add Satisfy() matcher #437

merged 1 commit into from Apr 25, 2021

Conversation

kaoet
Copy link
Contributor

@kaoet kaoet commented Apr 25, 2021

Satisfy() takes a predicate function and matches the actual value
against it.

isEven := func (i int) bool { return i%2==0 }
Expect(2).To(Satisfy(isEven))

Fixes #425

Satisfy() takes a predicate function and matches the actual value
against it.

```go
isEven := func (i int) bool { return i%2==0 }
Expect(2).To(Satisfy(isEven))
```
@kaoet kaoet changed the title Add Satisfy() matcher (#425) Add Satisfy() matcher Apr 25, 2021
@kaoet kaoet mentioned this pull request Apr 25, 2021
@onsi onsi merged commit c548f31 into onsi:master Apr 25, 2021
@onsi
Copy link
Owner

onsi commented Apr 25, 2021

Hey thanks for this @kaoet - looks great!

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.

How to match error with boolean function?
2 participants