diff --git a/spec/ruby/library/bigdecimal/round_spec.rb b/spec/ruby/library/bigdecimal/round_spec.rb index a1fb8d89f5e..6c1987c5d8d 100644 --- a/spec/ruby/library/bigdecimal/round_spec.rb +++ b/spec/ruby/library/bigdecimal/round_spec.rb @@ -193,4 +193,10 @@ lambda { BigDecimal('Infinity').round }.should raise_error(FloatDomainError) lambda { BigDecimal('-Infinity').round }.should raise_error(FloatDomainError) end + + it 'do not raise exception, if self is special value and precision is given' do + lambda { BigDecimal('NaN').round(2) }.should_not raise_error(FloatDomainError) + lambda { BigDecimal('Infinity').round(2) }.should_not raise_error(FloatDomainError) + lambda { BigDecimal('-Infinity').round(2) }.should_not raise_error(FloatDomainError) + end end