From 8dd6784d490df372408c783a87d93ba3a8157155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Wed, 14 May 2014 17:47:33 +0200 Subject: [PATCH] [BigDecimal] Add test to ensure we convert Float. --- test/test/spec/nsdecimal_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test/spec/nsdecimal_spec.rb b/test/test/spec/nsdecimal_spec.rb index 2ede919f..1b1440c2 100644 --- a/test/test/spec/nsdecimal_spec.rb +++ b/test/test/spec/nsdecimal_spec.rb @@ -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