diff options
Diffstat (limited to '')
-rw-r--r-- | dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal_test.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal_test.go b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal_test.go new file mode 100644 index 0000000..7491a1d --- /dev/null +++ b/dependencies/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/universal_test.go @@ -0,0 +1,40 @@ +package redis_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/go-redis/redis/v8" +) + +var _ = Describe("UniversalClient", func() { + var client redis.UniversalClient + + AfterEach(func() { + if client != nil { + Expect(client.Close()).To(Succeed()) + } + }) + + It("should connect to failover servers", func() { + client = redis.NewUniversalClient(&redis.UniversalOptions{ + MasterName: sentinelName, + Addrs: sentinelAddrs, + }) + Expect(client.Ping(ctx).Err()).NotTo(HaveOccurred()) + }) + + It("should connect to simple servers", func() { + client = redis.NewUniversalClient(&redis.UniversalOptions{ + Addrs: []string{redisAddr}, + }) + Expect(client.Ping(ctx).Err()).NotTo(HaveOccurred()) + }) + + It("should connect to clusters", func() { + client = redis.NewUniversalClient(&redis.UniversalOptions{ + Addrs: cluster.addrs(), + }) + Expect(client.Ping(ctx).Err()).NotTo(HaveOccurred()) + }) +}) |