Created
April 21, 2019 06:21
redis mock
This file contains hidden or 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