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

Use ReadLiner interface where possible.

This commit is contained in:
Vladimir Mihailenco
2012-08-09 14:51:43 +03:00
parent b2e3463af1
commit de86ea1993
3 changed files with 40 additions and 47 deletions

View File

@ -13,6 +13,8 @@ import (
"github.com/vmihailenco/redis"
)
const redisAddr = ":6379"
//------------------------------------------------------------------------------
type RedisTest struct {
@ -26,7 +28,7 @@ func Test(t *testing.T) { TestingT(t) }
//------------------------------------------------------------------------------
func (t *RedisTest) SetUpTest(c *C) {
t.client = redis.NewTCPClient(":6379", "", -1)
t.client = redis.NewTCPClient(redisAddr, "", -1)
c.Check(t.client.Flushdb().Err(), IsNil)
t.multiClient = t.client.Multi()
@ -40,7 +42,7 @@ func (t *RedisTest) TearDownTest(c *C) {
func (t *RedisTest) TestInitConn(c *C) {
openConn := func() (io.ReadWriter, error) {
return net.Dial("tcp", ":6379")
return net.Dial("tcp", redisAddr)
}
isInitConnCalled := false