Skip to content

Commit aaac6a9

Browse files
committed
Fix content-type test failure on macOS
Compare the canonical file paths, since Java creates temp files in /var which is a symlink for /private/var.
1 parent e381757 commit aaac6a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/clj/cider/nrepl/middleware/content_type_test.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@
4444
[:body :content-type :content-transfer-encoding :status]))))
4545

4646
(testing "java.io.File"
47-
(let [f (java.io.File/createTempFile "foo" ".txt")]
47+
(let [f (java.io.File/createTempFile "foo" ".txt")
48+
path (.getCanonicalPath f)]
4849
(is (= {:body ""
4950
:content-type
5051
["message/external-body"
51-
{:URL (str "file:" f) :access-type "URL"}]
52+
{:URL (str "file:" path) :access-type "URL"}]
5253
:status #{"done"}}
5354
(-> {:op "eval"
54-
:code (str "(java.io.File. " (pr-str (str f)) ")")
55+
:code (str "(java.io.File. " (pr-str path) ")")
5556
:content-type "true"}
5657
session/message
5758
(select-keys [:body :content-type :content-transfer-encoding :status]))))))

0 commit comments

Comments
 (0)