diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-10-02 06:34:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 06:34:50 -0700 |
commit | 257a985f5a7cff8f01891529ea89b0ea2800d61f (patch) | |
tree | a92ef593aec15889a3f2943f6ca359b361832c9b /vendor/github.com/onsi/gomega/matchers.go | |
parent | 32a2ce8fc0eb590140cad81cf0ca9adf2daa5651 (diff) | |
parent | 6c72b5c5926fdaed67936f0b1c6f948e3bf5c441 (diff) | |
download | podman-257a985f5a7cff8f01891529ea89b0ea2800d61f.tar.gz podman-257a985f5a7cff8f01891529ea89b0ea2800d61f.tar.bz2 podman-257a985f5a7cff8f01891529ea89b0ea2800d61f.zip |
Merge pull request #4150 from containers/dependabot/go_modules/github.com/onsi/gomega-1.7.0
Bump github.com/onsi/gomega from 1.5.0 to 1.7.0
Diffstat (limited to 'vendor/github.com/onsi/gomega/matchers.go')
-rw-r--r-- | vendor/github.com/onsi/gomega/matchers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/onsi/gomega/matchers.go b/vendor/github.com/onsi/gomega/matchers.go index c3a326dd4..9ec8893cb 100644 --- a/vendor/github.com/onsi/gomega/matchers.go +++ b/vendor/github.com/onsi/gomega/matchers.go @@ -269,6 +269,22 @@ func ContainElement(element interface{}) types.GomegaMatcher { } } +//BeElementOf succeeds if actual is contained in the passed in elements. +//BeElementOf() always uses Equal() to perform the match. +//When the passed in elements are comprised of a single element that is either an Array or Slice, BeElementOf() behaves +//as the reverse of ContainElement() that operates with Equal() to perform the match. +// Expect(2).Should(BeElementOf([]int{1, 2})) +// Expect(2).Should(BeElementOf([2]int{1, 2})) +//Otherwise, BeElementOf() provides a syntactic sugar for Or(Equal(_), Equal(_), ...): +// Expect(2).Should(BeElementOf(1, 2)) +// +//Actual must be typed. +func BeElementOf(elements ...interface{}) types.GomegaMatcher { + return &matchers.BeElementOfMatcher{ + Elements: elements, + } +} + //ConsistOf succeeds if actual contains precisely the elements passed into the matcher. The ordering of the elements does not matter. //By default ConsistOf() uses Equal() to match the elements, however custom matchers can be passed in instead. Here are some examples: // |