1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Rename Multi to Tx to better reflect the purpose. Fixes #194.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 11:23:58 +03:00
parent b351402995
commit 7a03514d7f
7 changed files with 124 additions and 149 deletions

View File

@ -66,11 +66,12 @@ var _ = Describe("Client", func() {
})
It("should close multi without closing the client", func() {
multi := client.Multi()
Expect(multi.Close()).NotTo(HaveOccurred())
tx, err := client.Watch()
Expect(err).NotTo(HaveOccurred())
Expect(tx.Close()).NotTo(HaveOccurred())
_, err := multi.Exec(func() error {
multi.Ping()
_, err = tx.Exec(func() error {
tx.Ping()
return nil
})
Expect(err).To(MatchError("redis: client is closed"))
@ -96,9 +97,10 @@ var _ = Describe("Client", func() {
})
It("should close multi when client is closed", func() {
multi := client.Multi()
tx, err := client.Watch()
Expect(err).NotTo(HaveOccurred())
Expect(client.Close()).NotTo(HaveOccurred())
Expect(multi.Close()).NotTo(HaveOccurred())
Expect(tx.Close()).NotTo(HaveOccurred())
})
It("should close pipeline when client is closed", func() {