Displaying 1 result from an estimated 1 matches for "other_money".
Did you mean:
other_model
2006 Feb 13
0
Money library error
Hello everyone !
The following test fails:
def test_substract_from_zero
assert_equal -12.to_money, Money.empty - (12.to_money)
end
This is equivalent to the normal arithmetic expression: 0 - 12 == -12.
The error is caused by the first line of Money#-(other_money)
def -(other_money)
return other_money.dup if cents.zero?
...
end
"return other_money.dup if cents.zero?" should be removed to pass the test case.
This is also on my blog.
Hope that helps someone !
--
Fran?ois Beausoleil
http://blog.teksol.info/