class ActiveModel::Type::BigIntegerTest

Public Instance Methods

test_large_values() click to toggle source
# File activemodel/test/cases/type/big_integer_test.rb, line 20
def test_large_values
  type = Type::BigInteger.new
  assert_equal 9999999999999999999999999999999, type.serialize(9999999999999999999999999999999)
end
test_small_values() click to toggle source
# File activemodel/test/cases/type/big_integer_test.rb, line 15
def test_small_values
  type = Type::BigInteger.new
  assert_equal(-9999999999999999999999999999999, type.serialize(-9999999999999999999999999999999))
end
test_type_cast_big_integer() click to toggle source
# File activemodel/test/cases/type/big_integer_test.rb, line 9
def test_type_cast_big_integer
  type = Type::BigInteger.new
  assert_equal 1, type.cast(1)
  assert_equal 1, type.cast("1")
end