functional-koans/clojure-koan-engine — pull request #6 by dkinzer (2013-07-28 03:44:12+00:00)
Title: Add expected/actual results to the error message.

Hello,
Thank you for such a beautiful application. I really appreciate being able to pick up Cloujure
in such a fun way.

So while I am going through the koans I found that often I make a stupid mistake that results in
expected result not equal to the actual. Usually in this case I then go through the process of copying
the koan to the clipboard, closing out the editor and opening the lein REPL and evaluating my answer
there to see what is happening.

As you can imagine that process becomes pretty tedious. So I made a change to the clojure-koan-engine
that helps in that scenario.

This pull request adds a two functions,expectations[] and expectations_to_s[]
that are then used to add expected and actual evaluated results to the
error message in the form:

expected: expected-result
actual: actual-result

This should help give the student more of a hint as to why a koan is failing.

For instance, one result could be:

Now meditate upon /home/vagrant/clojure-koans/src/koans/02_lists.clj:3
---------------------
Assertion failed!
Lists can be expressed by function or a quoted form
(= (quote (1 4 3 4 5)) (list 1 2 3 4 5))

-------------
expected: (1 4 3 4 5)
actual: (1 2 3 4 5)