Browse files

Fix ActiveRecord mysql tests

TL;DR: MySQL sucks.

Since it does not support transactions for schema changes,
when you run `create_table` in setup block, it will commit
current transaction. Now tests want to run `RELEASE SAVEPOINT`
after finishing tests which fails since there is no transaction.
  • Loading branch information...
1 parent e5df4f9 commit 66cabfc9d9eb748920a9aff62bd18b0033772f4e @drogus drogus committed Jan 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/test/cases/migration/logger_test.rb
View
3 activerecord/test/cases/migration/logger_test.rb
@@ -9,7 +9,7 @@ def migrate direction
end
end
- def setup
+ def initialize(*args)
super
ActiveRecord::SchemaMigration.create_table
ActiveRecord::SchemaMigration.delete_all
@@ -31,3 +31,4 @@ def test_migration_should_be_run_without_logger
end
end
end
+

2 comments on commit 66cabfc

@tenderlove
Ruby on Rails member

Shouldn't we just disable transactions for this test?

@drogus
Ruby on Rails member

Yes, good point, it would be better since there is delete_allin teardown anyway.

Please sign in to comment.