From 6527b680bfd6751507c60b3758563284b7ee68a3 Mon Sep 17 00:00:00 2001 From: Watson Date: Wed, 6 Feb 2013 12:17:17 +0900 Subject: [PATCH] update float spec which related to Float#round --- test/test/spec/float_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test/spec/float_spec.rb b/test/test/spec/float_spec.rb index f08960c1..1d00b67a 100644 --- a/test/test/spec/float_spec.rb +++ b/test/test/spec/float_spec.rb @@ -32,6 +32,12 @@ describe "Float" do 1356890400.step(1356908032.0, 7200.0).to_a.should == [1356890400.0, 1356897600.0, 1356904800.0] end + it "round" do + # issue 506 + flt = 0.678547.round(2) + flt.to_s.should == "0.68" + end + it "NSDecimalNumber.decimalNumberWithMantissa" do # issue 427 number = NSDecimalNumber.decimalNumberWithMantissa(3000000000, exponent: 0,isNegative: false) @@ -64,4 +70,4 @@ describe "Float" do f.__fixfloat__?.should == true end end -end \ No newline at end of file +end