aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-11 17:57:47 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-11 17:57:47 -0700
commitba0a6772bba983338562b1e305d90fcec4293007 (patch)
treea4cc222fb731db96e452664f64ce13dd35283a23
parent8e8a5f33f4e3190738a9d7e46f9d07bcd916d9d9 (diff)
downloadrails-ba0a6772bba983338562b1e305d90fcec4293007.tar.gz
rails-ba0a6772bba983338562b1e305d90fcec4293007.tar.bz2
rails-ba0a6772bba983338562b1e305d90fcec4293007.zip
testing floats, fixnum, and bignums
-rw-r--r--activerecord/test/cases/quoting_test.rb18
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