mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: bump github.com/onsi/ginkgo/v2 from 2.1.6 to 2.3.1
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.1.6 to 2.3.1. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.1.6...v2.3.1) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
53bb28e0d9
commit
3a490a4df0
45
vendor/github.com/onsi/gomega/matchers/be_key_of_matcher.go
generated
vendored
Normal file
45
vendor/github.com/onsi/gomega/matchers/be_key_of_matcher.go
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
package matchers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/onsi/gomega/format"
|
||||
)
|
||||
|
||||
type BeKeyOfMatcher struct {
|
||||
Map interface{}
|
||||
}
|
||||
|
||||
func (matcher *BeKeyOfMatcher) Match(actual interface{}) (success bool, err error) {
|
||||
if !isMap(matcher.Map) {
|
||||
return false, fmt.Errorf("BeKeyOf matcher needs expected to be a map type")
|
||||
}
|
||||
|
||||
if reflect.TypeOf(actual) == nil {
|
||||
return false, fmt.Errorf("BeKeyOf matcher expects actual to be typed")
|
||||
}
|
||||
|
||||
var lastError error
|
||||
for _, key := range reflect.ValueOf(matcher.Map).MapKeys() {
|
||||
matcher := &EqualMatcher{Expected: key.Interface()}
|
||||
success, err := matcher.Match(actual)
|
||||
if err != nil {
|
||||
lastError = err
|
||||
continue
|
||||
}
|
||||
if success {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
return false, lastError
|
||||
}
|
||||
|
||||
func (matcher *BeKeyOfMatcher) FailureMessage(actual interface{}) (message string) {
|
||||
return format.Message(actual, "to be a key of", presentable(valuesOf(matcher.Map)))
|
||||
}
|
||||
|
||||
func (matcher *BeKeyOfMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
||||
return format.Message(actual, "not to be a key of", presentable(valuesOf(matcher.Map)))
|
||||
}
|
Reference in New Issue
Block a user