blob: db1d2150839d5b0525dd7b905a9d34ef7315cbb5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type
class BigIntegerTest < ActiveModel::TestCase
def test_type_cast_big_integer
type = Type::BigInteger.new
assert_equal 1, type.cast(1)
assert_equal 1, type.cast("1")
end
def test_small_values
type = Type::BigInteger.new
assert_equal -9999999999999999999999999999999, type.serialize(-9999999999999999999999999999999)
end
def test_large_values
type = Type::BigInteger.new
assert_equal 9999999999999999999999999999999, type.serialize(9999999999999999999999999999999)
end
end
end
end
|