From ff7623f2ad1b9e6d1472ea0c774540e26ea64b24 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Tue, 19 Apr 2011 09:00:59 -0500 Subject: [PATCH] Fix file / line reporting for lazy defn loading, fixes #11. --- src/path_to_enlightenment.clj | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/path_to_enlightenment.clj b/src/path_to_enlightenment.clj index 963e469..c1b814c 100644 --- a/src/path_to_enlightenment.clj +++ b/src/path_to_enlightenment.clj @@ -1,7 +1,8 @@ (ns path-to-enlightenment (:use [clojure.test]) (:require [clojure.set] - [clojure.string])) + [clojure.string] + [clojure.test])) (def __ :fill-in-the-blank) (def ___ (fn [& args] __)) @@ -10,14 +11,16 @@ (System/exit 0)) (defmacro meditations [& forms] - (let [pairs (partition 2 forms)] - `(do - ~@(map - (fn [[doc# code#]] - `(if (is ~code# ~doc#) - :pass - (handle-problem))) - pairs)))) + (let [pairs (partition 2 forms) + pairs (conj pairs + ["Bootstrap for file/line reporting" + '(clojure.test/is (= 0 0))]) + tests (map (fn [[doc# code#]] + `(if (is ~code# ~doc#) + :pass + (handle-problem))) + pairs)] + `(do ~@tests))) (def ordered-koans ["equalities" @@ -62,5 +65,5 @@ (defn run [] (require-version (parse-required-version)) - (apply load (doall (map (partial str "koans/") ordered-koans))) + (doall (map (comp load (partial str "koans/")) ordered-koans)) (println "You have achieved clojure enlightenment. Namaste."))