Permalink
Browse files

skip the before_type_cast_on_datetime test entirely for mysql2

  • Loading branch information...
1 parent 42035fd commit d8b90114ddd2a432280d114b9fe4ef1fdb38d132 @brianmario brianmario committed Aug 2, 2010
Showing with 18 additions and 17 deletions.
  1. +18 −17 activerecord/test/cases/base_test.rb
@@ -123,23 +123,24 @@ def test_read_attributes_before_type_cast_on_boolean
end
end
- def test_read_attributes_before_type_cast_on_datetime
- developer = Developer.find(:first)
- # Oracle adapter returns Time before type cast
- if current_adapter?(:OracleAdapter)
- assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
-
- developer.created_at = "345643456"
- assert_equal developer.created_at_before_type_cast, "345643456"
- assert_equal developer.created_at, nil
-
- developer.created_at = "2010-03-21T21:23:32+01:00"
- assert_equal developer.created_at_before_type_cast, "2010-03-21T21:23:32+01:00"
- assert_equal developer.created_at, Time.parse("2010-03-21T21:23:32+01:00")
- elsif current_adapter?(:Mysql2Adapter)
- assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
- else
- assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
+ unless current_adapter?(:Mysql2Adapter)
+ def test_read_attributes_before_type_cast_on_datetime
+ developer = Developer.find(:first)
+ # Oracle adapter returns Time before type cast
+ if current_adapter?(:OracleAdapter)
+ assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
+
+ developer.created_at = "345643456"
+ assert_equal developer.created_at_before_type_cast, "345643456"
+ assert_equal developer.created_at, nil
+
+ developer.created_at = "2010-03-21T21:23:32+01:00"
+ assert_equal developer.created_at_before_type_cast, "2010-03-21T21:23:32+01:00"
+ assert_equal developer.created_at, Time.parse("2010-03-21T21:23:32+01:00")
+ assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
+ else
+ assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
+ end
end
end

0 comments on commit d8b9011

Please sign in to comment.