Sha256: 93f3a2488a66a5969ead472ac95300bec4b61ed8d791a70586686e84bd201d8d

Contents?: true

Size: 416 Bytes

Versions: 27

Compression:

Stored size: 416 Bytes

Contents

require 'test_helper'

# This tests our rounding extension
class Integer::RoundingTest < Minitest::Test
  def test_rounding
    assert_equal 124_000, 123_221.round_up_to(3)
    assert_equal 123_300, 123_221.round_up_to(4)
    assert_equal 760, 758.round_up_to(2)
    assert_equal 3453, 3452.round_up_to(4)
    assert_nil 1.round_up_to(2)
    refute_nil 10.round_up_to(2)
    assert_nil 12.round_up_to(-45)
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ndr_support-5.6.1 test/integer/rounding_test.rb
ndr_support-5.6.0 test/integer/rounding_test.rb
ndr_support-5.5.1 test/integer/rounding_test.rb
ndr_support-5.5.0 test/integer/rounding_test.rb
ndr_support-5.4.2 test/integer/rounding_test.rb
ndr_support-5.4.1 test/integer/rounding_test.rb
ndr_support-5.3.2 test/integer/rounding_test.rb