From 8959838563dbf95da3a7076e440d1913f2c97608 Mon Sep 17 00:00:00 2001
From: Phil Hagelberg <technomancy@gmail.com>
Date: Thu, 8 Oct 2009 21:29:25 -0700
Subject: [PATCH] Added test for delete-file

---
 .../contrib/test_contrib/test_java_utils.clj       |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/clojure/contrib/test_contrib/test_java_utils.clj b/src/clojure/contrib/test_contrib/test_java_utils.clj
index abf1b9a..ad011d1 100644
--- a/src/clojure/contrib/test_contrib/test_java_utils.clj
+++ b/src/clojure/contrib/test_contrib/test_java_utils.clj
@@ -88,7 +88,7 @@
         (is (= (inc propcount) (count (System/getProperties)))))
       (is (= propcount (count (System/getProperties))))))
 )
-	   
+
 (deftest test-as-properties
   (let [expected (doto (Properties.)
 		   (.setProperty "a" "b")
@@ -113,4 +113,11 @@
 	   (read-properties f)))))
 	   
 
-
+(deftest test-delete-file
+  (let [file (File/createTempFile "test" "deletion")
+        not-file (File. (str (java.util.UUID/randomUUID)))]
+    (delete-file (.getAbsolutePath file))
+    (is (not (.exists file)))
+    (is (thrown? ArithmeticException (/ 1 0)))
+    (is (thrown? java.io.IOException (delete-file not-file)))
+    (is (not (delete-file not-file :silently)))))
-- 
1.6.0.4


