Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

failing spec for #issue/12, Numeric#to_money should respect

:subunit_to_unit
  • Loading branch information...
commit 106b6b1d3262e20a851eba96d89611d9cf728668 1 parent 04fcbd2
@semmons99 semmons99 authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/core_extensions_spec.rb
View
6 test/core_extensions_spec.rb
@@ -23,6 +23,12 @@
1234.to_money('EUR').should == Money.new(123400, 'EUR')
end
+ specify "Numeric#to_money should respect :subunit_to_unit" do
+ 10.to_money('USD').should == Money.new(10_00, 'USD')
+ 10.to_money('TND').should == Money.new(10_000, 'TND')
+ 10.to_money('CLP').should == Money.new(10, 'CLP')
+ end
+
specify "String#to_money works" do
"20.15".to_money.should == Money.new(20_15)
"100".to_money.should == Money.new(100_00)
Please sign in to comment.
Something went wrong with that request. Please try again.