Skip to content
Browse files

Merge sqlite test fixes from trunk

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@7706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent fe1ee81 commit a11dc682a99b1eac547ca5a9bab36f58b7565a38 @NZKoz NZKoz committed Oct 1, 2007
Showing with 9 additions and 10 deletions.
  1. +9 −10 activerecord/test/migration_test.rb
View
19 activerecord/test/migration_test.rb
@@ -170,7 +170,7 @@ def test_create_table_with_limits
# SQL Server and Sybase will not allow you to add a NOT NULL column
# to a table without specifying a default value, so the
# following test must be skipped
- unless current_adapter?(:SQLServerAdapter, :SybaseAdapter)
+ unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter)
def test_add_column_not_null_without_default
Person.connection.create_table :testings do |t|
t.column :foo, :string
@@ -209,7 +209,7 @@ def test_add_column_not_null_with_default
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'
@@ -227,8 +227,9 @@ def test_native_decimal_insert_manual_vs_automatic
assert_kind_of BigDecimal, row.wealth
# If this assert fails, that means the SELECT is broken!
- assert_equal correct_value, row.wealth
-
+ unless current_adapter?(:SQLite3Adapter)
+ assert_equal correct_value, row.wealth
+ end
# Reset to old state
Person.delete_all
@@ -240,8 +241,9 @@ def test_native_decimal_insert_manual_vs_automatic
assert_kind_of BigDecimal, row.wealth
# If these asserts fail, that means the INSERT (create function, or cast to SQL) is broken!
- assert_equal correct_value, row.wealth
-
+ unless current_adapter?(:SQLite3Adapter)
+ assert_equal correct_value, row.wealth
+ end
# Reset to old state
Person.connection.del_column "people", "wealth" rescue nil
Person.reset_column_information
@@ -267,10 +269,7 @@ def test_native_types
# 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
+ unless current_adapter?(:SQLite3Adapter)
assert_equal BigDecimal.new("0012345678901234567890.0123456789"), bob.wealth
end

0 comments on commit a11dc68

Please sign in to comment.
Something went wrong with that request. Please try again.