Created
April 21, 2019 06:21
-
-
Save erez-rabih/e7ba026a00a8b3fa306094f7c1de1e30 to your computer and use it in GitHub Desktop.
redis mock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns test.redis-mock) | |
(defn mock-redis [f] | |
(let [redis-storage (atom {})] | |
(with-redefs [redis/set (fn [key value] (swap! redis-storage assoc key value)) | |
redis/get (fn [key] (get @redis-storage key))] | |
(f)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment