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

Remove special cases for BigDecimal and SQLite, tests pass without them and fail with them.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6437 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Michael Koziarski 2007-03-16 21:41:09 +00:00
parent c593721e7c
commit 16b4739e1e

View file

@ -212,9 +212,7 @@ if ActiveRecord::Base.connection.supports_migrations?
# functionality. This allows us to more easily catch INSERT being broken,
# but SELECT actually working fine.
def test_native_decimal_insert_manual_vs_automatic
# SQLite3 always uses float in violation of SQL
# 16 decimal places
correct_value = (current_adapter?(:SQLiteAdapter) ? '0.123456789012346E20' : '0012345678901234567890.0123456789').to_d
correct_value = '0012345678901234567890.0123456789'.to_d
Person.delete_all
Person.connection.add_column "people", "wealth", :decimal, :precision => '30', :scale => '10'
@ -280,12 +278,8 @@ if ActiveRecord::Base.connection.supports_migrations?
# Test for 30 significent digits (beyond the 16 of float), 10 of them
# after the decimal place.
if current_adapter?(:SQLiteAdapter)
# SQLite3 uses float in violation of SQL. Test for 16 decimal places.
assert_equal BigDecimal.new('0.123456789012346E20'), bob.wealth
else
assert_equal BigDecimal.new("0012345678901234567890.0123456789"), bob.wealth
end
assert_equal BigDecimal.new("0012345678901234567890.0123456789"), bob.wealth
assert_equal true, bob.male?