Skip to content

Commit

Permalink
do not raise when precision is passed to BigDecimal#round
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Nov 28, 2015
1 parent f1193d6 commit e881d92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/ruby/library/bigdecimal/round_spec.rb
Expand Up @@ -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

0 comments on commit e881d92

Please sign in to comment.