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 22 (:require
33 [cider.nrepl.middleware.slurp :refer [if-class slurp-url-to-content+body]]
44 [clojure.java.io :as io]
5- [clojure.test :as t]))
5+ [clojure.test :as t]
6+ [clojure.string :as str]))
67
78; ; FIXME (arrdem 2018-04-11):
89; ; Remove these if-classes when we have jdk1.8 min
2223 (io/resource " sum-types-are-cool.jpg" )))]
2324 (t/is (= [" image/jpeg" {}] (:content-type resp)))
2425 (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