summaryrefslogtreecommitdiff
path: root/compojure-3.2/test/helpers.clj
blob: 9f2704b4d615d2703b69628d5794ebc96f502c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(ns test.helpers
  (:import java.io.ByteArrayInputStream)
  (:import java.io.File))

(defn input-stream [s]
  (ByteArrayInputStream. (.getBytes s)))

(defn form-request [body]
  {:content-type "application/x-www-form-urlencoded"
   :body (input-stream body)})

(defn temp-file []
  (doto (File/createTempFile "compojure" "test")
    (.deleteOnExit)))