diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-03-23 18:20:28 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-23 18:22:46 -0700 |
commit | ed21f0c50270139ddb6993acfdaea4586ffd09a3 (patch) | |
tree | 1b091545c5a27908e01362e83330c1f772d719ee /activerecord/test | |
parent | bc48d39e4c0348f627f9bf2d9090082c54a052c7 (diff) | |
download | rails-ed21f0c50270139ddb6993acfdaea4586ffd09a3.tar.gz rails-ed21f0c50270139ddb6993acfdaea4586ffd09a3.tar.bz2 rails-ed21f0c50270139ddb6993acfdaea4586ffd09a3.zip |
expand migration paths before requiring them. [#4240 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 03ee8dcf3c..e213986ede 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1104,6 +1104,19 @@ if ActiveRecord::Base.connection.supports_migrations? assert_equal migrations[0].name, 'InnocentJointable' end + def test_relative_migrations + $".delete_if do |fname| + fname == (MIGRATIONS_ROOT + "/valid/1_people_have_last_names.rb") + end + Object.send(:remove_const, :PeopleHaveLastNames) + + Dir.chdir(MIGRATIONS_ROOT) do + ActiveRecord::Migrator.up("valid/", 1) + end + + assert defined?(PeopleHaveLastNames) + end + def test_only_loads_pending_migrations # migrate up to 1 ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/valid", 1) |