Description
When the minimum and maximum amounts are identical Money.within? raises an ArgumentError.
Expected Behavior:
Money.within?(Money.new(:ZAR, "20"), Money.new(:ZAR, "20"), Money.new(:ZAR, "20"))
should return true.
Current Behavior
Money.within?(Money.new(:ZAR, "20"), Money.new(:ZAR, "20"), Money.new(:ZAR, "20"))
raises the following Error instead:
** (ArgumentError) Minimum must be less than maximum. Found Money.new(:ZAR, "20") and Money.new(:ZAR, "20")
(ex_money 5.19.0) lib/money.ex:1576: Money.within?/3
The comparison between min and max should be inclusive and only fail if minimum is greater than maximum but if the amounts are equal no error shoud be raised
Suggested Change
if compare(minimum, maximum) == :lt do
-> if compare(minimum, maximum) in [:lt, :eq] do