summaryrefslogtreecommitdiff
path: root/compojure-3.2/test/helpers.clj
diff options
context:
space:
mode:
Diffstat (limited to 'compojure-3.2/test/helpers.clj')
-rwxr-xr-xcompojure-3.2/test/helpers.clj14
1 files changed, 14 insertions, 0 deletions
diff --git a/compojure-3.2/test/helpers.clj b/compojure-3.2/test/helpers.clj
new file mode 100755
index 0000000..9f2704b
--- /dev/null
+++ b/compojure-3.2/test/helpers.clj
@@ -0,0 +1,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)))