ExUnit case template that spins up an isolated FauxRedis server per test.
Usage:
defmodule MyTest do
use FauxRedis.Case, async: true
test "example", %{redis_server: server, redis_port: port} do
{:ok, _rule} = FauxRedis.stub(server, :get, "value")
assert is_integer(port)
end
end
Summary
Functions
Convenience wrapper around FauxRedis.expect/3 that reads the server from
the test context.
Convenience wrapper around FauxRedis.stub/3 that reads the server from
the test context.
Functions
@spec expect(map(), FauxRedis.matcher(), FauxRedis.response_spec()) :: {:ok, reference()}
Convenience wrapper around FauxRedis.expect/3 that reads the server from
the test context.
@spec stub(map(), FauxRedis.matcher(), FauxRedis.response_spec()) :: {:ok, reference()}
Convenience wrapper around FauxRedis.stub/3 that reads the server from
the test context.