mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-06-10 10:15:57 +00:00
Switch to ginkgo/gomega for tests
This switches over to ginkgo/gomega for tests, which makes writing certain tests easier/more fluent in the future.
This commit is contained in:
parent
c5801455ec
commit
cc08a1fb41
260 changed files with 184637 additions and 6412 deletions
28
vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go
generated
vendored
Normal file
28
vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package matchers
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/onsi/gomega/format"
|
||||
)
|
||||
|
||||
type BeZeroMatcher struct {
|
||||
}
|
||||
|
||||
func (matcher *BeZeroMatcher) Match(actual interface{}) (success bool, err error) {
|
||||
if actual == nil {
|
||||
return true, nil
|
||||
}
|
||||
zeroValue := reflect.Zero(reflect.TypeOf(actual)).Interface()
|
||||
|
||||
return reflect.DeepEqual(zeroValue, actual), nil
|
||||
|
||||
}
|
||||
|
||||
func (matcher *BeZeroMatcher) FailureMessage(actual interface{}) (message string) {
|
||||
return format.Message(actual, "to be zero-valued")
|
||||
}
|
||||
|
||||
func (matcher *BeZeroMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
||||
return format.Message(actual, "not to be zero-valued")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue