mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-05-19 04:17:08 +08:00
[BigDecimal] Add test to ensure we convert Float.
This commit is contained in:
@@ -25,6 +25,10 @@ describe 'BigDecimal' do
|
||||
end
|
||||
|
||||
it 'can be created with a float' do
|
||||
should.not.raise TypeError do
|
||||
BigDecimal.new(0.1)
|
||||
end
|
||||
|
||||
# Use 0.0 here because it's the only Float we can trust to not lose precision.
|
||||
number = 0.0
|
||||
number.class.should == Float
|
||||
|
||||
Reference in New Issue
Block a user