From eb4724bd72cd80bc9313ff195faa263a0b8577e2 Mon Sep 17 00:00:00 2001 From: Karl Pietrzak Date: Thu, 2 Apr 2026 17:17:49 -0400 Subject: [PATCH] test tweak: allow resource-response to return InputStream or File If the tests are run from a JAR, the response will be an `InputStream`. In exploded sources, the response can be a `File`. Tests now check for either --- ring-core/test/ring/util/test/response.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ring-core/test/ring/util/test/response.clj b/ring-core/test/ring/util/test/response.clj index de699454..219882fa 100644 --- a/ring-core/test/ring/util/test/response.clj +++ b/ring-core/test/ring/util/test/response.clj @@ -148,7 +148,8 @@ (is (instance? File body)) (is (.startsWith (slurp body) "(ns ring.util.response"))) (let [body (:body (resource-response "clojure/java/io.clj"))] - (is (instance? InputStream body)) + ;; JAR on classpath → InputStream; exploded sources → File + (is (or (instance? InputStream body) (instance? File body))) (is (.contains (slurp body) "clojure.java.io")))) (testing "resource is a directory"