Show how to test koans for Equalities

This commit is contained in:
Felipe Sere
2016-03-10 16:44:29 +00:00
parent 95c620129d
commit eb1da4b1fc
7 changed files with 24 additions and 48 deletions

View File

@@ -1,8 +1,7 @@
defmodule Koans do
defmacro koan(name, body) do
compiled_name = String.to_atom(name)
x = quote do: answer
mangled_body = ASTMangler.expand(body, x)
mangled_body = ASTMangler.expand(body, quote do: answer)
quote do
@koans unquote(compiled_name)
def unquote(compiled_name)(answer \\ :nothing) do