Document gomega.Equal() instead of gomega.BeEqual()

BeEqual() doesn't exist, document Equal() instead (as used in the
actual code).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
Stephen Kitt 2023-04-17 22:47:38 +02:00
parent 94a15929cf
commit 0a8343352b
No known key found for this signature in database
GPG Key ID: 1CC5FA453662A71D

View File

@ -81,7 +81,7 @@ var _ types.GomegaMatcher = &matcher[string]{}
// assertions. The difference is that failed assertions are returned as an
// error:
//
// if err := Gomega().Expect(pod.Status.Phase).To(gomega.BeEqual(v1.Running)); err != nil {
// if err := Gomega().Expect(pod.Status.Phase).To(gomega.Equal(v1.Running)); err != nil {
// return fmt.Errorf("test pod not running: %w", err)
// }
//
@ -294,14 +294,14 @@ var ErrFailure error = FailureError{}
// ExpectEqual expects the specified two are the same, otherwise an exception raises
//
// Deprecated: use gomega.Expect().To(gomega.BeEqual())
// Deprecated: use gomega.Expect().To(gomega.Equal())
func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{}) {
gomega.ExpectWithOffset(1, actual).To(gomega.Equal(extra), explain...)
}
// ExpectNotEqual expects the specified two are not the same, otherwise an exception raises
//
// Deprecated: use gomega.Expect().ToNot(gomega.BeEqual())
// Deprecated: use gomega.Expect().ToNot(gomega.Equal())
func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{}) {
gomega.ExpectWithOffset(1, actual).NotTo(gomega.Equal(extra), explain...)
}