Skip to content

Commit

Permalink
failing spec for #issue/12, Numeric#to_money should respect
Browse files Browse the repository at this point in the history
:subunit_to_unit
  • Loading branch information
semmons99 committed Jul 12, 2010
1 parent 04fcbd2 commit 106b6b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/core_extensions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 106b6b1

Please sign in to comment.