Skip to content
This repository
Browse code

Quick follow-up.

Condense test-merge-env-2.  I'm still getting the hang of this Clojure deal.
  • Loading branch information...
commit 72c7594f3670f0700ff868040e00b01e08896c6b 1 parent d602eb3
Jed Denlea authored

Showing 1 changed file with 9 additions and 11 deletions. Show diff stats Hide diff stats

  1. +9 11 src/test/clj/com/climate/shell_test.clj
20 src/test/clj/com/climate/shell_test.clj
@@ -39,17 +39,15 @@
39 39 :env (merge-env {:FOO "bar"}))))))
40 40
41 41 (deftest test-merge-env-2
42   - (is (let [java-home (get (System/getenv) "JAVA_HOME")]
43   - (and
44   - (not-empty java-home)
45   - (.startsWith
46   - (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
47   - "(vector
48   - (get (System/getenv) \"JAVA_HOME\")
49   - (get (System/getenv) \"FOO\"))"
50   - :err :pass
51   - :env (merge-env {:FOO "bar"})))
52   - (str "[" (pr-str java-home) " \"bar\"]"))))))
  42 + (is (when-let [java-home (not-empty (get (System/getenv) "JAVA_HOME"))]
  43 + (.startsWith
  44 + (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
  45 + "(vector
  46 + (get (System/getenv) \"JAVA_HOME\")
  47 + (get (System/getenv) \"FOO\"))"
  48 + :err :pass
  49 + :env (merge-env {:FOO "bar"})))
  50 + (str "[" (pr-str java-home) " \"bar\"]")))))
53 51
54 52 (deftest test-sh-with-files
55 53 (let [txt "some test text"

0 comments on commit 72c7594

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