Create a test file for each of the koan modules

This commit is contained in:
Felipe Sere
2016-04-23 11:46:45 +01:00
parent 4c5009c697
commit b1479487b0
14 changed files with 250 additions and 215 deletions

View File

@@ -1 +1,17 @@
ExUnit.start()
defmodule TestHarness do
defmacro __using__(_) do
quote do
def test_all(module, answers) do
module.all_koans
|> Enum.zip(answers)
|> run_all(module)
end
def run_all(pairs, module) do
Enum.map(pairs, fn ({koan, answer}) -> Execute.run_koan(module, koan, [answer]) end)
end
end
end
end