diff --git a/project.clj b/project.clj index b06153c..427a3a4 100644 --- a/project.clj +++ b/project.clj @@ -2,4 +2,5 @@ :description "Koan Engine for Clojure projects." :dependencies [[org.clojure/clojure "1.4.0"] [fresh "1.0.2"] - [jline "0.9.94" :exclusions [junit]]]) + [jline "0.9.94" :exclusions [junit]] + [io.aviso/pretty "0.1.18"]]) diff --git a/src/koan_engine/koans.clj b/src/koan_engine/koans.clj index d064616..8cde0bc 100644 --- a/src/koan_engine/koans.clj +++ b/src/koan_engine/koans.clj @@ -1,7 +1,8 @@ (ns koan-engine.koans (:use [clojure.java.io :only [file resource]]) (:require [koan-engine.util :as u] - [clojure.string :as str])) + [clojure.string :as str] + [io.aviso.ansi :as pretty])) ;; TODO: Proper koan validation. Accept the path as an argument. (defn ordered-koans [answer-path] @@ -24,11 +25,11 @@ (defn report-error [file-path line error] (let [message (or (.getMessage error) (.toString error))] - (println "\nNow meditate upon" - (str (last (str/split file-path #"/")) - (when line (str ":" line)))) + (println (str "\nNow meditate upon " + (pretty/blue (str (last (str/split file-path #"/")) + (when line (str ":" line)))))) (println "---------------------") - (println "Assertion failed!") + (println (pretty/bold-red "Assertion failed!")) (println (.replaceFirst message "^Assert failed: " "")))) (defn tests-pass? [dojo-path file-path]