1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Fix all examples in readme. Req now implements Stringer interface for debugging purposes.

This commit is contained in:
Vladimir Mihailenco
2013-02-17 18:49:17 +02:00
parent ed0d065f72
commit a07e186fb3
4 changed files with 232 additions and 61 deletions

View File

@ -270,6 +270,19 @@ func (t *RedisTest) resetRedis(c *C) {
//------------------------------------------------------------------------------
func (t *RedisTest) TestReqStringMethod(c *C) {
set := t.client.Set("foo", "bar")
c.Assert(set.String(), Equals, "SET foo bar: OK")
get := t.client.Get("foo")
c.Assert(get.String(), Equals, "GET foo: bar")
}
func (t *RedisTest) TestReqStringMethodError(c *C) {
get2 := t.client.Get("key_does_not_exists")
c.Assert(get2.String(), Equals, "GET key_does_not_exists: (nil)")
}
func (t *RedisTest) TestRunWithouthCheckingErrVal(c *C) {
set := t.client.Set("key", "hello")
c.Assert(set.Err(), IsNil)