Skip to content
Browse files

fix order dependent test related to migration

If the order in which tests are executed is changed then test fails.
This commit ensures that all migrations are run before ensuring that
there are no pending migration.
  • Loading branch information...
1 parent bffda1e commit 10259c3e906da2191ef0d43cd664a3b5504d9f8c @neerajdotname neerajdotname committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 activerecord/test/cases/migration_test.rb
View
4 activerecord/test/cases/migration_test.rb
@@ -846,6 +846,10 @@ def test_copying_migrations_to_empty_directory
end
def test_check_pending_with_stdlib_logger
+ migrations_path = MIGRATIONS_ROOT + "/valid"
+ ActiveRecord::Migrator.migrations_paths = migrations_path
+ ActiveRecord::Migrator.up migrations_path
+
old, ActiveRecord::Base.logger = ActiveRecord::Base.logger, ::Logger.new($stdout)
quietly do
assert_nothing_raised { ActiveRecord::Migration::CheckPending.new(Proc.new {}).call({}) }

0 comments on commit 10259c3

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