diff --git a/test/e2e/framework/expect.go b/test/e2e/framework/expect.go index 3d66fca1194..17f1a3a3cd6 100644 --- a/test/e2e/framework/expect.go +++ b/test/e2e/framework/expect.go @@ -293,13 +293,6 @@ func (f *FailureError) backtrace() { // } var ErrFailure error = FailureError{} -// ExpectEqual expects the specified two are the same, otherwise an exception raises -// -// 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.Equal()) diff --git a/test/e2e/framework/log_test.go b/test/e2e/framework/log_test.go index ce8c2d157f7..5f74eb3d4ab 100644 --- a/test/e2e/framework/log_test.go +++ b/test/e2e/framework/log_test.go @@ -24,6 +24,7 @@ import ( "github.com/onsi/ginkgo/v2" "github.com/onsi/ginkgo/v2/reporters" + "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -36,8 +37,7 @@ import ( // Be careful when moving it around or changing the import statements above. // Here are some intentionally blank lines that can be removed to compensate // for future additional import statements. -// -// This must be line #39. +// This must be line #40. // This is included in a stack backtrace. func failHelper(msg string) { @@ -50,7 +50,7 @@ var _ = ginkgo.Describe("log", func() { }) ginkgo.AfterEach(func() { framework.Logf("after") - framework.ExpectEqual(true, false, "true is never false either") + gomega.Expect(true).To(gomega.BeFalse(), "true is never false either") }) ginkgo.It("fails", func() { func() { @@ -58,14 +58,14 @@ var _ = ginkgo.Describe("log", func() { }() }) ginkgo.It("asserts", func() { - framework.ExpectEqual(false, true, "false is never true") + gomega.Expect(false).To(gomega.BeTrue(), "false is never true") }) ginkgo.It("error", func() { err := errors.New("an error with a long, useless description") framework.ExpectNoError(err, "hard-coded error") }) ginkgo.It("equal", func() { - framework.ExpectEqual(0, 1, "of course it's not equal...") + gomega.Expect(0).To(gomega.Equal(1), "of course it's not equal...") }) ginkgo.It("fails with helper", func() { failHelper("I'm failing with helper.") @@ -109,8 +109,7 @@ INFO: after [FAILED] true is never false either Expected : true -to equal - : false +to be false In [AfterEach] at: log_test.go:53