diff --git a/command_test.go b/command_test.go index a0d753e8..e9fc958c 100644 --- a/command_test.go +++ b/command_test.go @@ -1,9 +1,10 @@ package redis_test import ( + "errors" "time" - "github.com/go-redis/redis/v7" + redis "github.com/go-redis/redis/v7" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -84,4 +85,12 @@ var _ = Describe("Cmd", func() { Expect(err).NotTo(HaveOccurred()) Expect(tm2).To(BeTemporally("==", tm)) }) + + It("allow to set custom error", func() { + e := errors.New("custom error") + cmd := redis.Cmd{} + cmd.SetErr(e) + _, err := cmd.Result() + Expect(err).To(Equal(e)) + }) })