Merge pull request #20632 from containers/renovate/github.com-onsi-gomega-1.x

fix(deps): update module github.com/onsi/gomega to v1.30.0
This commit is contained in:
openshift-ci[bot]
2023-11-09 15:34:01 +00:00
committed by GitHub
8 changed files with 53 additions and 9 deletions

2
go.mod
View File

@ -47,7 +47,7 @@ require (
github.com/moby/term v0.5.0 github.com/moby/term v0.5.0
github.com/nxadm/tail v1.4.11 github.com/nxadm/tail v1.4.11
github.com/onsi/ginkgo/v2 v2.13.0 github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.29.0 github.com/onsi/gomega v1.30.0
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5 github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.10 github.com/opencontainers/runc v1.1.10

4
go.sum
View File

@ -838,8 +838,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=

View File

@ -1,3 +1,12 @@
## 1.30.0
### Features
- BeTrueBecause and BeFalseBecause allow for better failure messages [4da4c7f]
### Maintenance
- Bump actions/checkout from 3 to 4 (#694) [6ca6e97]
- doc: fix type on gleak go doc [f1b8343]
## 1.29.0 ## 1.29.0
### Features ### Features

View File

@ -22,7 +22,7 @@ import (
"github.com/onsi/gomega/types" "github.com/onsi/gomega/types"
) )
const GOMEGA_VERSION = "1.29.0" const GOMEGA_VERSION = "1.30.0"
const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler. const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler.
If you're using Ginkgo then you probably forgot to put your assertion in an It(). If you're using Ginkgo then you probably forgot to put your assertion in an It().

View File

@ -1,6 +1,7 @@
package gomega package gomega
import ( import (
"fmt"
"time" "time"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
@ -52,15 +53,31 @@ func BeNil() types.GomegaMatcher {
} }
// BeTrue succeeds if actual is true // BeTrue succeeds if actual is true
//
// In general, it's better to use `BeTrueBecause(reason)` to provide a more useful error message if a true check fails.
func BeTrue() types.GomegaMatcher { func BeTrue() types.GomegaMatcher {
return &matchers.BeTrueMatcher{} return &matchers.BeTrueMatcher{}
} }
// BeFalse succeeds if actual is false // BeFalse succeeds if actual is false
//
// In general, it's better to use `BeFalseBecause(reason)` to provide a more useful error message if a false check fails.
func BeFalse() types.GomegaMatcher { func BeFalse() types.GomegaMatcher {
return &matchers.BeFalseMatcher{} return &matchers.BeFalseMatcher{}
} }
// BeTrueBecause succeeds if actual is true and displays the provided reason if it is false
// fmt.Sprintf is used to render the reason
func BeTrueBecause(format string, args ...any) types.GomegaMatcher {
return &matchers.BeTrueMatcher{Reason: fmt.Sprintf(format, args...)}
}
// BeFalseBecause succeeds if actual is false and displays the provided reason if it is true.
// fmt.Sprintf is used to render the reason
func BeFalseBecause(format string, args ...any) types.GomegaMatcher {
return &matchers.BeFalseMatcher{Reason: fmt.Sprintf(format, args...)}
}
// HaveOccurred succeeds if actual is a non-nil error // HaveOccurred succeeds if actual is a non-nil error
// The typical Go error checking pattern looks like: // The typical Go error checking pattern looks like:
// //

View File

@ -9,6 +9,7 @@ import (
) )
type BeFalseMatcher struct { type BeFalseMatcher struct {
Reason string
} }
func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err error) { func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err error) {
@ -20,9 +21,17 @@ func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err erro
} }
func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) { func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) {
return format.Message(actual, "to be false") if matcher.Reason == "" {
return format.Message(actual, "to be false")
} else {
return matcher.Reason
}
} }
func (matcher *BeFalseMatcher) NegatedFailureMessage(actual interface{}) (message string) { func (matcher *BeFalseMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return format.Message(actual, "not to be false") if matcher.Reason == "" {
return format.Message(actual, "not to be false")
} else {
return fmt.Sprintf(`Expected not false but got false\nNegation of "%s" failed`, matcher.Reason)
}
} }

View File

@ -9,6 +9,7 @@ import (
) )
type BeTrueMatcher struct { type BeTrueMatcher struct {
Reason string
} }
func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) { func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) {
@ -20,9 +21,17 @@ func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error
} }
func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) { func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) {
return format.Message(actual, "to be true") if matcher.Reason == "" {
return format.Message(actual, "to be true")
} else {
return matcher.Reason
}
} }
func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) { func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return format.Message(actual, "not to be true") if matcher.Reason == "" {
return format.Message(actual, "not to be true")
} else {
return fmt.Sprintf(`Expected not true but got true\nNegation of "%s" failed`, matcher.Reason)
}
} }

2
vendor/modules.txt vendored
View File

@ -823,7 +823,7 @@ github.com/onsi/ginkgo/v2/internal/parallel_support
github.com/onsi/ginkgo/v2/internal/testingtproxy github.com/onsi/ginkgo/v2/internal/testingtproxy
github.com/onsi/ginkgo/v2/reporters github.com/onsi/ginkgo/v2/reporters
github.com/onsi/ginkgo/v2/types github.com/onsi/ginkgo/v2/types
# github.com/onsi/gomega v1.29.0 # github.com/onsi/gomega v1.30.0
## explicit; go 1.18 ## explicit; go 1.18
github.com/onsi/gomega github.com/onsi/gomega
github.com/onsi/gomega/format github.com/onsi/gomega/format