branch: externals/plz
commit 60c8e3fe160f0fbd3385983ad65ed5407e2d4fcc
Author: Joseph Turner <jos...@breatheoutbreathe.in>
Commit: Joseph Turner <jos...@breatheoutbreathe.in>

    Tests: (plz-head-temp-file) Add
---
 tests/test-plz.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/test-plz.el b/tests/test-plz.el
index 8725b9e4dc..415edfd6f5 100644
--- a/tests/test-plz.el
+++ b/tests/test-plz.el
@@ -470,6 +470,16 @@ in URL-encoded form)."
       ;; It's a temp file, so it should always be deleted.
       (delete-file filename))))
 
+(plz-deftest plz-head-temp-file ()
+  (let ((filename (plz 'head (url "/image/jpeg")
+                    :as 'file :then 'sync)))
+    (unwind-protect
+        (with-temp-buffer
+          (insert-file-contents filename)
+          (should (re-search-forward "Content-Type: image/jpeg")))
+      ;; It's a temp file, so it should always be deleted.
+      (delete-file filename))))
+
 (plz-deftest plz-get-named-file ()
   (let ((filename (make-temp-file "plz-")))
     ;; HACK: Delete the temp file and reuse its name, because

Reply via email to