                          "test/fail-gradle-no-task.bat"
                          "test/fail-gradle-no-task.bash"))))]
               (is (= 1 (-> build-doc :process :exit-code)))
-              (is (.contains (-> @email :body first :content)
-                             "Cannot expand ZIP")
-                  (-> @email :body first :content))))
+              (let [body (:body @email)
+                    content (find-content body)]
+                (when (is content body)
+                  (is (.contains content "Cannot expand ZIP")))
+                (is (= 3 (count body))
+                    (pr-str @email)))))
           (testing "with gradle task"
             (let [out (java.io.StringWriter.)
                   [opts res build-doc]

  (is (= "foo@q***.dom"
         (email/obfuscate-addr "foo@bar.quux.dom"))))

(deftest attached
  (testing "failures present"
    (let [email (atom [])]

                         "test/fail-gradle-with-task.bat"
                         "test/fail-gradle-with-task.bash"))))]
              (is (= 1 (-> build-doc :process :exit-code)))
              (let [body (:body @email)
                    content (find-content body)]
                (when (is content body)
                  (is (.contains content ":core:integTest")))
                (is (= 4 (count body))
                    (pr-str @email))))))))))
