Skip to content
Browse files

Quick follow-up.

Condense test-merge-env-2.  I'm still getting the hang of this Clojure deal.
  • Loading branch information...
1 parent d602eb3 commit 72c7594f3670f0700ff868040e00b01e08896c6b Jed Denlea committed Mar 20, 2013
Showing with 9 additions and 11 deletions.
  1. +9 −11 src/test/clj/com/climate/shell_test.clj
View
20 src/test/clj/com/climate/shell_test.clj
@@ -39,17 +39,15 @@
:env (merge-env {:FOO "bar"}))))))
(deftest test-merge-env-2
- (is (let [java-home (get (System/getenv) "JAVA_HOME")]
- (and
- (not-empty java-home)
- (.startsWith
- (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
- "(vector
- (get (System/getenv) \"JAVA_HOME\")
- (get (System/getenv) \"FOO\"))"
- :err :pass
- :env (merge-env {:FOO "bar"})))
- (str "[" (pr-str java-home) " \"bar\"]"))))))
+ (is (when-let [java-home (not-empty (get (System/getenv) "JAVA_HOME"))]
+ (.startsWith
+ (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
+ "(vector
+ (get (System/getenv) \"JAVA_HOME\")
+ (get (System/getenv) \"FOO\"))"
+ :err :pass
+ :env (merge-env {:FOO "bar"})))
+ (str "[" (pr-str java-home) " \"bar\"]")))))
(deftest test-sh-with-files
(let [txt "some test text"

0 comments on commit 72c7594

Please sign in to comment.
Something went wrong with that request. Please try again.