diff options
Diffstat (limited to 'src/clojure/contrib/test_contrib/test_java_utils.clj')
-rw-r--r-- | src/clojure/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 abf1b9a6..8e0f67c4 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 (delete-file not-file :silently)))) |