Ok.  That sounds reasonable.

On Thu, Mar 21, 2013 at 1:43 PM, Jed Denlea <notifications@github.com>wrote:

> In src/test/clj/com/climate/shell_test.clj:
>
> > @@ -39,14 +39,15 @@
> >                    :env (merge-env {:FOO "bar"}))))))
> >
> >  (deftest test-merge-env-2
> > -  (is (re-find
> > -        #"\[\"[\.\/\w]+\" \"bar\"\]"
> > -        (: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"}))))))
> > +  (is (when-let [java-home (not-empty (get (System/getenv) "JAVA_HOME"))]
>
> While we could add a hyphen to the regular expression, it seems sloppy to
> use a regular expression to test if a known value is present. What this
> test is doing is taking the existing known environment, attempting to
> create a new one, and proving that this new environment is useful to child
> processes. Consider, in some pathological case, what if merge-env actually
> corrupted all of the existing environment entries? So, to that end, I think
> this is a more meaningful approach, testing explicitly whether or not our
> new env is in fact just like our old one with some new values added.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/TheClimateCorporation/lemur/pull/18/files#r3475554>
> .
>