(ns fcms.lib.http-mock)

(def req) ; mock HTTP request
(def bod) ; body of the mock HTTP request or response
(def resp) ; mock HTTP response

(defn request
  ([] req)
  ([new-req] (def req new-req)))

(defn body
  ([] bod)
  ([new-body] (def bod new-body)))

(defn response
  ([] resp)
  ([new-resp] (def resp new-resp)))

(ns fcms.lib.http-mock)

(def mock-data (atom {:request {} :body "" :response {}}))

(defn request
  ([] (:request @mock-data))
  ([new-request] (swap! mock-data assoc :request new-request)))

(defn body
  ([] (:body @mock-data))
  ([new-body] (swap! mock-data assoc :body new-body)))

(defn response
  ([] (:response @mock-data))
  ([new-response] (swap! mock-data assoc :response new-response)))
Change how the mock data state is held for cucumber tests.
Change how the mock data state is held for cucumber tests.

SnootyMonkey/Falkland-CMS