- The
.createClient
client/server works and can be used to replace (Redis + the node_redis client) in your apps' tests - TODO: implement the rest of the commants
- TODO: implement the (client/server-independent test)-runner
del, exists, getbit, getrange, getset, lindex, linsert, llen, lpop, lpush, lpushx, lrange, lrem, lset, ltrim, mget, mset, msetnx, randomkey, rename, renamenx, rpop, rpoplpush, rpush, rpushx, sadd, scard, sdiff, sdiffstore, setnx, sinter, strlen, type
For example, here's src/commands/get.coffee
module.exports = get: (k) -> if @items[k]? @assertString @items[k] else null tests: eg: """ set k, v: OK get k: v """ wrong_type: """ non-string k: OK get k: ERROR """
For details, see src/OVERVIEW.md
This client-with-its-own-server can be useful for development/testing, and will be tested for full equivalence to mranney's node_redis.
var redis = require('redis-semantics'); var client = redis.createClient(); ... client.append(k, v, fuction(err, reply) { ... })
For example, to test node_redis + Redis 2.0:
TODO
TODO
cd redis-semantics; npm link cake build && cake test