mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Add expectNoError helper to handle Expect(err).NotTo(HaveOccurred()) meme
And convert one file
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/clientauth"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
type testContextType struct {
|
||||
@@ -152,3 +153,7 @@ func randomSuffix() string {
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
return strconv.Itoa(r.Int() % 10000)
|
||||
}
|
||||
|
||||
func expectNoError(err error, explain ...interface{}) {
|
||||
ExpectWithOffset(1, err).NotTo(HaveOccurred(), explain...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user