kipcole9 / money

Elixir implementation of Money with Currency
https://hex.pm/packages/ex_money
Other
572 stars 48 forks source link

Money.from_integer spec doesn't agree with output #136

Closed jdewar closed 2 years ago

jdewar commented 2 years ago

spec for from_integer error is a 3-tuple, but the output in the case of an error is a 2-tuple with a 2-tuple in the second slot.

spec says: from_integer(integer(), currency_code(), Keyword.t()) :: t() | {:error, module(), String.t()}

iex says:

iex(2)> Money.from_integer(1000, :UD) 
{:error, {Cldr.UnknownCurrencyError, "The currency :UD is invalid"}}
kipcole9 commented 2 years ago

Thanks for the report. I have published ex_money version 5.7.2 with the following changelog entry:

Bug Fixes

Enhancements