A Redis mock for Lua with the same interface as redis-lua.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis
rockspec
.luacheckrc
.travis.yml
CHANGELOG.md
LICENSE.txt
Makefile
README.md
fakeredis.lua
fakeredis.test.lua
supported.txt

README.md

fakeredis

Build Status

Presentation

fakeredis is a Redis mock for Lua with the same interface as redis-lua.

Dependencies

Lua 5.1 users will need Lua BitOp.

If you do not set a custom sleep function and LuaSocket is not installed, a busy wait will be used for sleep().

Tests require cwtest.

Usage

local R = fakeredis.new()
R:set("foo", "bar")
local foo = R:get("bar")

See redis-lua for more.

Design

fakeredis tries to keep its interface compatible with redis-lua but is not fully complete, see supported.txt for supported commands.

fakeredis does not support multiple DBs. You should probably not use them anyway. If you really need SELECT in tests it is easy to write a small wrapper that uses multiple instances of fakeredis.

Copyright

Copyright (c) 2012-2016 Pierre Chapuis