(ns http)
(defn post [url]
{:body "Hello world"})
(ns app
(:require [clojure.test :refer [run-tests]]))
(deftest is-a-fn
(with-redefs-fn {http/post (fn [url] {:body "Goodbye world again"})}
#(is (= {:body "Goodbye world again"} (http/post "http://service.com/greet")))))
(run-tests) ;; test is passing
(ns http)
(defn post [url]
{:body "Hello world"})
(ns app
(:require [clojure.test :refer [run-tests]]))
(deftest is-a-fn
(with-redefs-fn {http/post (fn [url] {:body "Goodbye world again"})}
#(is (= {:body "Goodbye world again"} (http/post "http://service.com/greet")))))
(run-tests) ;; test is passing