12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package framework
- import (
- "github.com/onsi/gomega"
- )
- func ExpectEqual(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.Equal(extra), explain...)
- }
- func ExpectEqualValues(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.BeEquivalentTo(extra), explain...)
- }
- func ExpectEqualValuesWithOffset(offset int, actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1+offset, actual).To(gomega.BeEquivalentTo(extra), explain...)
- }
- func ExpectNotEqual(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).NotTo(gomega.Equal(extra), explain...)
- }
- func ExpectError(err error, explain ...interface{}) {
- gomega.ExpectWithOffset(1, err).To(gomega.HaveOccurred(), explain...)
- }
- func ExpectErrorWithOffset(offset int, err error, explain ...interface{}) {
- gomega.ExpectWithOffset(1+offset, err).To(gomega.HaveOccurred(), explain...)
- }
- func ExpectNoError(err error, explain ...interface{}) {
- ExpectNoErrorWithOffset(1, err, explain...)
- }
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) {
- gomega.ExpectWithOffset(1+offset, err).NotTo(gomega.HaveOccurred(), explain...)
- }
- func ExpectContainSubstring(actual, substr string, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.ContainSubstring(substr), explain...)
- }
- func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.ConsistOf(extra), explain...)
- }
- func ExpectContainElements(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.ContainElements(extra), explain...)
- }
- func ExpectNotContainElements(actual interface{}, extra interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).NotTo(gomega.ContainElements(extra), explain...)
- }
- func ExpectHaveKey(actual interface{}, key interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.HaveKey(key), explain...)
- }
- func ExpectEmpty(actual interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).To(gomega.BeEmpty(), explain...)
- }
- func ExpectTrue(actual interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1, actual).Should(gomega.BeTrue(), explain...)
- }
- func ExpectTrueWithOffset(offset int, actual interface{}, explain ...interface{}) {
- gomega.ExpectWithOffset(1+offset, actual).Should(gomega.BeTrue(), explain...)
- }
|