Sha256: 1738f1a4b251c0309c280da2acc9d9d6367faf0d218f4a5ab33b2bdf03c2f84a

Contents?: true

Size: 395 Bytes

Versions: 2

Compression:

Stored size: 395 Bytes

Contents

module BigDecimalSpecs
  # helper method to sure that the global limit is reset back
  def self.with_limit(l)
    old = BigDecimal.limit(l)
    yield
  ensure
    BigDecimal.limit(old)
  end

  def self.with_rounding(r)
    old = BigDecimal.mode(BigDecimal::ROUND_MODE)
    BigDecimal.mode(BigDecimal::ROUND_MODE, r)
    yield
  ensure
    BigDecimal.mode(BigDecimal::ROUND_MODE, old)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubysl-bigdecimal-1.0.0 spec/fixtures/classes.rb
rubysl-bigdecimal-2.0.2 spec/fixtures/classes.rb