mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Don't return an error when pipeline is empty
This commit is contained in:
@ -34,16 +34,17 @@ var _ = Describe("pipelining", func() {
|
||||
})
|
||||
|
||||
assertPipeline := func() {
|
||||
It("returns an error when there are no commands", func() {
|
||||
It("returns no errors when there are no commands", func() {
|
||||
_, err := pipe.Exec()
|
||||
Expect(err).To(MatchError("redis: pipeline is empty"))
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
It("discards queued commands", func() {
|
||||
pipe.Get("key")
|
||||
pipe.Discard()
|
||||
_, err := pipe.Exec()
|
||||
Expect(err).To(MatchError("redis: pipeline is empty"))
|
||||
cmds, err := pipe.Exec()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(cmds).To(BeNil())
|
||||
})
|
||||
|
||||
It("handles val/err", func() {
|
||||
|
Reference in New Issue
Block a user