Initial commit

This commit is contained in:
Uku Taht
2015-12-15 17:53:27 +00:00
commit ae6b5a7f19
10 changed files with 168 additions and 0 deletions

22
lib/koans.ex Normal file
View File

@@ -0,0 +1,22 @@
defmodule Koans do
defmacro koan(name, body) do
compiled_name = :"koan: #{name}"
quote do
def unquote(compiled_name)() do
try do
unquote(body)
:ok
rescue
e in ExUnit.AssertionError -> e
end
end
end
end
defmacro __using__(_) do
quote do
import Koans
import ExUnit.Assertions
end
end
end