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:
@@ -22,6 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/onsi/gomega"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -138,6 +139,16 @@ func (eCtx *errorContext) CleanupCtx(cb func(TContext)) {
|
|||||||
cleanupCtx(eCtx, cb)
|
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 {
|
func (eCtx *errorContext) Logger() klog.Logger {
|
||||||
return klog.FromContext(eCtx)
|
return klog.FromContext(eCtx)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user