Changeset 7706
- Timestamp:
- 10/01/07 02:14:31 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1-2-stable/activerecord/test/migration_test.rb
r5938 r7706 171 171 # to a table without specifying a default value, so the 172 172 # following test must be skipped 173 unless current_adapter?(:SQLServerAdapter, :SybaseAdapter )173 unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter) 174 174 def test_add_column_not_null_without_default 175 175 Person.connection.create_table :testings do |t| … … 210 210 # SQLite3 always uses float in violation of SQL 211 211 # 16 decimal places 212 correct_value = (current_adapter?(:SQLiteAdapter) ? '0.123456789012346E20' : '0012345678901234567890.0123456789').to_d212 correct_value = '0012345678901234567890.0123456789'.to_d 213 213 214 214 Person.delete_all … … 228 228 229 229 # If this assert fails, that means the SELECT is broken! 230 assert_equal correct_value, row.wealth 231 230 unless current_adapter?(:SQLite3Adapter) 231 assert_equal correct_value, row.wealth 232 end 232 233 # Reset to old state 233 234 Person.delete_all … … 241 242 242 243 # If these asserts fail, that means the INSERT (create function, or cast to SQL) is broken! 243 assert_equal correct_value, row.wealth 244 244 unless current_adapter?(:SQLite3Adapter) 245 assert_equal correct_value, row.wealth 246 end 245 247 # Reset to old state 246 248 Person.connection.del_column "people", "wealth" rescue nil … … 268 270 # Test for 30 significent digits (beyond the 16 of float), 10 of them 269 271 # after the decimal place. 270 if current_adapter?(:SQLiteAdapter) 271 # SQLite3 uses float in violation of SQL. Test for 16 decimal places. 272 assert_equal BigDecimal.new('0.123456789012346E20'), bob.wealth 273 else 272 unless current_adapter?(:SQLite3Adapter) 274 273 assert_equal BigDecimal.new("0012345678901234567890.0123456789"), bob.wealth 275 274 end