From d0467e08e54a84fc4672c508716615aa0177994a Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 3 Dec 2010 13:12:59 +0100 Subject: Allow to run migrations from more than one directory --- activerecord/test/cases/migration_test.rb | 12 ++++++++++++ 1 file changed, 12 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 96da3be655..95b7ce9f34 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1275,6 +1275,18 @@ if ActiveRecord::Base.connection.supports_migrations? end end + def test_finds_migrations_from_two_directories + directories = [MIGRATIONS_ROOT + '/valid_with_timestamps', MIGRATIONS_ROOT + '/to_copy_with_timestamps'] + migrations = ActiveRecord::Migrator.new(:up, directories).migrations + + [[20090101010101, "PeopleHaveHobbies"], [20090101010202, "PeopleHaveDescriptions"], + [20100101010101, "PeopleHaveLastNames"], [20100201010101, "WeNeedReminders"], + [20100301010101, "InnocentJointable"]].each_with_index do |pair, i| + assert_equal migrations[i].version, pair.first + assert_equal migrations[i].name, pair.last + end + end + def test_finds_pending_migrations ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2", 1) migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + "/interleaved/pass_2").pending_migrations -- cgit v1.2.3