Skip to content

catwell/fakeredis

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

fakeredis

CI 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-2022 Pierre Chapuis

About

A Redis mock for Lua with the same interface as redis-lua.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages