Add expectNoError helper to handle Expect(err).NotTo(HaveOccurred()) meme

And convert one file
This commit is contained in:
Zach Loafman
2015-02-12 10:37:31 -08:00
parent 62ff434825
commit 6117592905
2 changed files with 15 additions and 14 deletions

View File

@@ -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...)
}