Skip to content

Instantly share code, notes, and snippets.

@pmarreck
Created April 28, 2015 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmarreck/5be9c3f934a1c65e441c to your computer and use it in GitHub Desktop.
Save pmarreck/5be9c3f934a1c65e441c to your computer and use it in GitHub Desktop.
elixir argument error...
test "single digits" do
%{zero: 0, one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9}
|>
Enum.each(fn {word, num} ->
IO.puts "asserting #{word} == #{num}"
assert to_string(word) == NumbersToWords.parse(num)
end)
end
# I keep getting an argument error as it ends up trying to do :erlang.integer_to_binary("8")
# instead of :erlang.integer_to_binary(8)... Probably due to how the "assert" macro works... How to fix?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment