From 10259c3e906da2191ef0d43cd664a3b5504d9f8c Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Sun, 28 Jul 2013 14:14:24 +0530 Subject: 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. --- activerecord/test/cases/migration_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test/cases/migration_test.rb') diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index ed080b2995..4474c22cf8 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -846,6 +846,10 @@ class CopyMigrationsTest < ActiveRecord::TestCase 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({}) } -- cgit v1.2.3