Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7706

Show
Ignore:
Timestamp:
10/01/07 02:14:31 (1 year ago)
Author:
nzkoz
Message:

Merge sqlite test fixes from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1-2-stable/activerecord/test/migration_test.rb

    r5938 r7706  
    171171    # to a table without specifying a default value, so the 
    172172    # following test must be skipped 
    173     unless current_adapter?(:SQLServerAdapter, :SybaseAdapter
     173    unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter
    174174      def test_add_column_not_null_without_default 
    175175        Person.connection.create_table :testings do |t| 
     
    210210      # SQLite3 always uses float in violation of SQL 
    211211      # 16 decimal places 
    212       correct_value = (current_adapter?(:SQLiteAdapter) ? '0.123456789012346E20' : '0012345678901234567890.0123456789').to_d 
     212      correct_value = '0012345678901234567890.0123456789'.to_d 
    213213 
    214214      Person.delete_all 
     
    228228 
    229229      # 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 
    232233      # Reset to old state 
    233234      Person.delete_all 
     
    241242 
    242243      # 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 
    245247      # Reset to old state 
    246248      Person.connection.del_column "people", "wealth" rescue nil 
     
    268270      # Test for 30 significent digits (beyond the 16 of float), 10 of them 
    269271      # 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) 
    274273        assert_equal BigDecimal.new("0012345678901234567890.0123456789"), bob.wealth 
    275274      end