File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
clj/cider/nrepl/middleware Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2
2
(:require
3
3
[cider.nrepl.middleware.slurp :refer [if-class slurp-url-to-content+body]]
4
4
[clojure.java.io :as io]
5
- [clojure.test :as t]))
5
+ [clojure.test :as t]
6
+ [clojure.string :as str]))
6
7
7
8
; ; FIXME (arrdem 2018-04-11):
8
9
; ; Remove these if-classes when we have jdk1.8 min
22
23
(io/resource " sum-types-are-cool.jpg" )))]
23
24
(t/is (= [" image/jpeg" {}] (:content-type resp)))
24
25
(t/is (= " base64" (:content-transfer-encoding resp))))))
26
+
27
+ (if-class java.util.Base64
28
+ (t/deftest test-unrecognized-file
29
+ (let [resp (slurp-url-to-content+body
30
+ (.toString (io/resource " unknown.bin" )))]
31
+ (t/is (= [" application/octet-stream" {}] (:content-type resp)))
32
+ (t/is (str/starts-with? (:body resp) " #binary[location=" ))
33
+ (t/is (str/ends-with? (:body resp) " ,size=3]" )))))
Original file line number Diff line number Diff line change
1
+ foo
You can’t perform that action at this time.
0 commit comments