Sha256: b20aae1003b8feba1a027630aaf3f7275eaead46e9108201529caeb55ebea8e8

Contents?: true

Size: 405 Bytes

Versions: 14

Compression:

Stored size: 405 Bytes

Contents

require 'test_helper'

# This tests our Integer extension
class IntegerTest < 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

14 entries across 14 versions & 1 rubygems

Version Path
ndr_support-5.3.1 test/integer_test.rb
ndr_support-5.3.0 test/integer_test.rb
ndr_support-5.2.0 test/integer_test.rb
ndr_support-5.1.0 test/integer_test.rb
ndr_support-4.2.0 test/integer_test.rb
ndr_support-5.0.0 test/integer_test.rb
ndr_support-4.1.2 test/integer_test.rb
ndr_support-4.1.1 test/integer_test.rb
ndr_support-4.0.1 test/integer_test.rb
ndr_support-4.0.0 test/integer_test.rb
ndr_support-3.3.0 test/integer_test.rb
ndr_support-3.2.1 test/integer_test.rb
ndr_support-3.2.0 test/integer_test.rb
ndr_support-3.1.1 test/integer_test.rb