Skip to content

rutaka-n/eredis_mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eredis_mock

It is a simple library for mocking eredis queries in tests. It really terrible to use real redis for tests, especially for unit-tests, so this library allows to mock particular queries for eredis.

Example

    {ok, Pid} = eredis_mock:start_link(),
    Request = ["SET", "key", "value"],
    Response = {ok, <<"MOCK">>},
    eredis_mock:set_mock(Redis, Request, Response),
    ?assertEqual(Response, eredis:q(Redis, Request)),

Build

$ rebar3 compile