diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2009-04-10 02:47:52 +0000 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2009-04-10 02:47:52 +0000 |
commit | 71c8d51d0a920a46eef39117aab33a9f59c10bf2 (patch) | |
tree | 000696aacd729eb81f32279553531625afc29459 /src/clojure/contrib/test_contrib/test_java_utils.clj | |
parent | 00bfc0caaf56e879bced5c7dbcd2f513fd0ea9a8 (diff) |
Stuart S's suggestions for properties
Diffstat (limited to 'src/clojure/contrib/test_contrib/test_java_utils.clj')
-rw-r--r-- | src/clojure/contrib/test_contrib/test_java_utils.clj | 8 |
1 files changed, 6 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 1a3e6ba5..409f07b2 100644 --- a/src/clojure/contrib/test_contrib/test_java_utils.clj +++ b/src/clojure/contrib/test_contrib/test_java_utils.clj @@ -49,13 +49,17 @@ (testing "works the same with keywords, symbols, and strings" (is (= (get-system-property "java.home") (get-system-property 'java.home))) (is (= (get-system-property "java.home") (get-system-property :java.home)))) + (testing "treats second arg as default" + (is (= "default" (get-system-property "testing.test-system-property" "default")))) + (testing "returns nil for missing properties" + (is (nil? (get-system-property "testing.test-system-property")))) ) (deftest test-set-system-properties - (testing "set and then unset a property" + (testing "set and then unset a property using keywords" (let [propname :clojure.contrib.java-utils.test-set-system-properties] (is (nil? (get-system-property propname))) - (set-system-properties {propname "foo"}) + (set-system-properties {propname :foo}) (is (= "foo") (get-system-property propname)) (set-system-properties {propname nil}) (is (nil? (get-system-property propname))))) |