rebase: bump github.com/onsi/gomega from 1.18.1 to 1.19.0

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.18.1 to 1.19.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.18.1...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2022-03-28 20:10:26 +00:00
committed by mergify[bot]
parent 4652b8facf
commit 134603540b
12 changed files with 337 additions and 47 deletions

View File

@ -256,16 +256,26 @@ func BeZero() types.GomegaMatcher {
return &matchers.BeZeroMatcher{}
}
//ContainElement succeeds if actual contains the passed in element.
//By default ContainElement() uses Equal() to perform the match, however a
//matcher can be passed in instead:
//ContainElement succeeds if actual contains the passed in element. By default
//ContainElement() uses Equal() to perform the match, however a matcher can be
//passed in instead:
// Expect([]string{"Foo", "FooBar"}).Should(ContainElement(ContainSubstring("Bar")))
//
//Actual must be an array, slice or map.
//For maps, ContainElement searches through the map's values.
func ContainElement(element interface{}) types.GomegaMatcher {
//Actual must be an array, slice or map. For maps, ContainElement searches
//through the map's values.
//
//If you want to have a copy of the matching element(s) found you can pass a
//pointer to a variable of the appropriate type. If the variable isn't a slice
//or map, then exactly one match will be expected and returned. If the variable
//is a slice or map, then at least one match is expected and all matches will be
//stored in the variable.
//
// var findings []string
// Expect([]string{"Foo", "FooBar"}).Should(ContainElement(ContainSubString("Bar", &findings)))
func ContainElement(element interface{}, result ...interface{}) types.GomegaMatcher {
return &matchers.ContainElementMatcher{
Element: element,
Result: result,
}
}
@ -320,6 +330,20 @@ func ContainElements(elements ...interface{}) types.GomegaMatcher {
}
}
//HaveEach succeeds if actual solely contains elements that match the passed in element.
//Please note that if actual is empty, HaveEach always will succeed.
//By default HaveEach() uses Equal() to perform the match, however a
//matcher can be passed in instead:
// Expect([]string{"Foo", "FooBar"}).Should(HaveEach(ContainSubstring("Foo")))
//
//Actual must be an array, slice or map.
//For maps, HaveEach searches through the map's values.
func HaveEach(element interface{}) types.GomegaMatcher {
return &matchers.HaveEachMatcher{
Element: element,
}
}
//HaveKey succeeds if actual is a map with the passed in key.
//By default HaveKey uses Equal() to perform the match, however a
//matcher can be passed in instead: