Skip to content

Commit

Permalink
Fix auto-runner for exceptions without causes or messages, fixes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
trptcolin committed Sep 23, 2011
1 parent 9239c1d commit 652cc6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runner/koans.clj
Expand Up @@ -47,9 +47,10 @@
(println "Problem in" file-path)
(println "---------------------")
(println "Assertion failed!")
(println (.replaceFirst (.getMessage (.getCause e))
"^Assert failed: "
""))
(let [actual-error (or (.getCause e) e)
message (or (.getMessage actual-error)
(.toString actual-error))]
(println (.replaceFirst message "^Assert failed: " "")))
false)))

(defn namaste []
Expand Down

0 comments on commit 652cc6d

Please sign in to comment.