From ba0a6772bba983338562b1e305d90fcec4293007 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 11 Oct 2010 17:57:47 -0700 Subject: testing floats, fixnum, and bignums --- activerecord/test/cases/quoting_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 -- cgit v1.2.3