diff options
-rw-r--r-- | activerecord/test/cases/quoting_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb index 22aab378de..989c25a708 100644 --- a/activerecord/test/cases/quoting_test.rb +++ b/activerecord/test/cases/quoting_test.rb @@ -110,6 +110,24 @@ module ActiveRecord assert_equal @quoter.quoted_false, @quoter.quote(false, nil) assert_equal '0', @quoter.quote(false, Struct.new(:type).new(:integer)) end + + def test_quote_float + float = 1.2 + assert_equal float.to_s, @quoter.quote(float, nil) + assert_equal float.to_s, @quoter.quote(float, Object.new) + end + + def test_quote_fixnum + fixnum = 1 + assert_equal fixnum.to_s, @quoter.quote(fixnum, nil) + assert_equal fixnum.to_s, @quoter.quote(fixnum, Object.new) + end + + def test_quote_bignum + bignum = 1 << 100 + assert_equal bignum.to_s, @quoter.quote(bignum, nil) + assert_equal bignum.to_s, @quoter.quote(bignum, Object.new) + end end end end |