diff options
Diffstat (limited to 'activerecord/test/cases/column_test.rb')
-rw-r--r-- | activerecord/test/cases/column_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/column_test.rb b/activerecord/test/cases/column_test.rb index 8017a49827..800cfbdef9 100644 --- a/activerecord/test/cases/column_test.rb +++ b/activerecord/test/cases/column_test.rb @@ -56,6 +56,14 @@ module ActiveRecord column = Column.new("field", nil, "integer") assert_nil column.type_cast(Object.new) end + + if RUBY_VERSION > '1.9' + def test_type_cast_nan_and_infinity_to_integer + column = Column.new("field", nil, "integer") + assert_nil column.type_cast(Float::NAN) + assert_nil column.type_cast(1.0/0.0) + end + end end end end |