Fixes the reported line for failures using assert_receive

It needed to be turned into a macro and some tinkering with
external vars was needed.
This commit is contained in:
Felipe Sere
2016-04-10 20:53:10 +01:00
parent c8079b77df
commit 395182c68d
2 changed files with 10 additions and 10 deletions

View File

@@ -41,13 +41,14 @@ defmodule Koans do
end
defp create_vars(amount) do
Enum.map(0..amount, fn (idx) -> quote do: elem(converted, unquote(idx)) end)
for id <- 0..amount, do: quote do: elem(converted, unquote(id))
end
defmacro __using__(_opts) do
quote do
@compile :nowarn_unused_vars
Module.register_attribute(__MODULE__, :koans, accumulate: true)
require ExUnit.Assertions
import Koans
import BlankAssertions