diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2009-04-10 02:23:29 +0000 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2009-04-10 02:23:29 +0000 |
commit | 00bfc0caaf56e879bced5c7dbcd2f513fd0ea9a8 (patch) | |
tree | 2c66f3209a49951eb6c5ed9cba699b622ba2ce9d | |
parent | 45bd387c1e3ddf431a5c7123b5bc4279125b4751 (diff) |
simplified tests to avoid permanent fixtures per discussion on mailing list
-rw-r--r-- | build.xml | 2 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib/test_java_utils.clj | 14 | ||||
-rw-r--r-- | test/fixtures/test_java_utils.properties | 2 |
3 files changed, 9 insertions, 9 deletions
@@ -8,7 +8,6 @@ <property name="src" location="src"/> <property name="build" location="classes"/> - <property name="test.temp.dir" location="test/tmp"/> <available property="hasclojure" file="${clojure.jar}"/> @@ -49,7 +48,6 @@ <target name="test_contrib" description = "Run contrib tests" if="hasclojure"> - <mkdir dir="${test.temp.dir}"/> <java classname="clojure.main"> <classpath> <path location="${build}"/> diff --git a/src/clojure/contrib/test_contrib/test_java_utils.clj b/src/clojure/contrib/test_contrib/test_java_utils.clj index 5c2588a3..1a3e6ba5 100644 --- a/src/clojure/contrib/test_contrib/test_java_utils.clj +++ b/src/clojure/contrib/test_contrib/test_java_utils.clj @@ -1,5 +1,6 @@ (ns clojure.contrib.test-contrib.test-java-utils (:use clojure.contrib.test-is + [clojure.contrib.duck-streams :only (spit)] clojure.contrib.java-utils) (:import [java.io File] [java.util Properties])) @@ -88,13 +89,16 @@ (as-properties [[:a :b] [:c :d]])))))) (deftest test-read-properties - (is (= {"a" "b" "c" "d"} - (read-properties (file "test/fixtures/test_java_utils.properties"))))) + (let [f (File/createTempFile "test" "properties")] + (spit f "a=b\nc=d") + (is (= {"a" "b" "c" "d"} + (read-properties f))))) (deftest test-write-properties - (write-properties [['a 'b] ['c 'd]] (file "test/tmp/test_java_utils_write_properties.properties")) - (is (= {"a" "b" "c" "d"} - (read-properties (file "test/tmp/test_java_utils_write_properties.properties"))))) + (let [f (File/createTempFile "test" "properties")] + (write-properties [['a 'b] ['c 'd]] f) + (is (= {"a" "b" "c" "d"} + (read-properties f))))) diff --git a/test/fixtures/test_java_utils.properties b/test/fixtures/test_java_utils.properties deleted file mode 100644 index 20c0243a..00000000 --- a/test/fixtures/test_java_utils.properties +++ /dev/null @@ -1,2 +0,0 @@ -a=b -c=d |