ExUnit.start()
defmodule ParameterizedTest do
use ExUnit.Case, async: true
ExUnit.Case.register_attribute __ENV__, :pair
for {lhs, rhs} <- [{"one", 1}, {"two", 2}, {"three", 3}] do
@pair {lhs, rhs}
test "#{lhs} convert to #{rhs}", context do
{l, r} = context.registered.pair
assert l === r
end
end
test "pair should not have any value" do
assert nil === @pair
end
end