Closed AlexBaranosky closed 12 years ago
Code change:
(defn stub-fn [function-name return-value] (swap! call-times assoc function-name []) (fn [& args] (swap! call-times update-in [function-name] conj args) (if (fn? return-value) (apply return-value args) ;; pass the args in return-value)))
This way you can say:
(binding [logger (fn [msg] (println "we're logging your message: " msg))] (is (= :foo (bar-maker))))
Code change:
This way you can say: