1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add a valid hex that shouldn't be valid to ActiveModel numericality tests [#4622 state:commited]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
rohit 2010-05-18 05:54:53 +05:30 committed by José Valim
parent 73f0e1a842
commit 05e3fb45ee

View file

@ -18,7 +18,7 @@ class NumericalityValidationTest < ActiveModel::TestCase
FLOATS = [0.0, 10.0, 10.5, -10.5, -0.0001] + FLOAT_STRINGS
INTEGERS = [0, 10, -10] + INTEGER_STRINGS
BIGDECIMAL = BIGDECIMAL_STRINGS.collect! { |bd| BigDecimal.new(bd) }
JUNK = ["not a number", "42 not a number", "0xdeadbeef", "0xinvalidhex", "00-1", "--3", "+-3", "+3-1", "-+019.0", "12.12.13.12", "123\nnot a number"]
JUNK = ["not a number", "42 not a number", "0xdeadbeef", "0xinvalidhex", "0Xdeadbeef", "00-1", "--3", "+-3", "+3-1", "-+019.0", "12.12.13.12", "123\nnot a number"]
INFINITY = [1.0/0.0]
def test_default_validates_numericality_of