mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
ktesting: add missing methods to error context
Expect and ExpectNoError were not implemented and thus unintentionally inherited from the base TContext.
This commit is contained in:
parent
dc6abc3ff8
commit
4ffa628ead
@ -22,6 +22,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/onsi/gomega"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
@ -138,6 +139,16 @@ func (eCtx *errorContext) CleanupCtx(cb func(TContext)) {
|
||||
cleanupCtx(eCtx, cb)
|
||||
}
|
||||
|
||||
func (eCtx *errorContext) Expect(actual interface{}, extra ...interface{}) gomega.Assertion {
|
||||
eCtx.Helper()
|
||||
return expect(eCtx, actual, extra...)
|
||||
}
|
||||
|
||||
func (eCtx *errorContext) ExpectNoError(err error, explain ...interface{}) {
|
||||
eCtx.Helper()
|
||||
expectNoError(eCtx, err, explain...)
|
||||
}
|
||||
|
||||
func (eCtx *errorContext) Logger() klog.Logger {
|
||||
return klog.FromContext(eCtx)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user