diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 14:14:24 +0530 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 14:14:24 +0530 |
commit | 10259c3e906da2191ef0d43cd664a3b5504d9f8c (patch) | |
tree | f8e33ff3b7a5841cc14d03b17700532432770d18 | |
parent | bffda1e65e41c77c6c7fc8053feee6dddd0900ef (diff) | |
download | rails-10259c3e906da2191ef0d43cd664a3b5504d9f8c.tar.gz rails-10259c3e906da2191ef0d43cd664a3b5504d9f8c.tar.bz2 rails-10259c3e906da2191ef0d43cd664a3b5504d9f8c.zip |
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.
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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({}) } |