diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 12:15:54 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2011-12-09 12:15:54 +0100 |
commit | 929b2646b606e639a127bdd17f1aad169a26e2c5 (patch) | |
tree | d65049a1800c9dba9068b3bd230f6794703600cb /activerecord/test/cases | |
parent | ed0b1f6eed6d894f9a0f32a226d29337782ada3c (diff) | |
download | rails-929b2646b606e639a127bdd17f1aad169a26e2c5.tar.gz rails-929b2646b606e639a127bdd17f1aad169a26e2c5.tar.bz2 rails-929b2646b606e639a127bdd17f1aad169a26e2c5.zip |
Compare migrations for copying only by name and scope
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index c185efe1d6..b5fae3b7d3 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -2226,7 +2226,7 @@ if ActiveRecord::Base.connection.supports_migrations? clear end - def test_skip_is_not_called_if_migrations_are_identical + def test_skip_is_not_called_if_migrations_are_from_the_same_plugin @migrations_path = MIGRATIONS_ROOT + "/valid_with_timestamps" @existing_migrations = Dir[@migrations_path + "/*.rb"] @@ -2244,31 +2244,6 @@ if ActiveRecord::Base.connection.supports_migrations? clear end - def test_skip_ignores_origin_comment - ActiveRecord::Base.timestamped_migrations = false - @migrations_path = MIGRATIONS_ROOT + "/valid" - @existing_migrations = Dir[@migrations_path + "/*.rb"] - - sources = ActiveSupport::OrderedHash.new - sources[:bukkits] = MIGRATIONS_ROOT + "/to_copy" - - skipped = [] - on_skip = Proc.new { |name, migration| skipped << "#{name} #{migration.name}" } - copied = ActiveRecord::Migration.copy(@migrations_path, sources, :on_skip => on_skip) - - # remove origin comment - migration = @migrations_path + "/4_people_have_hobbies.bukkits.rb" - migration_source = File.read(migration).lines.to_a[1..-1].join - File.open(migration, "w") { |f| f.write migration_source } - - ActiveRecord::Migration.copy(@migrations_path, sources, :on_skip => on_skip) - - assert_equal 2, copied.length - assert_equal 0, skipped.length - ensure - clear - end - def test_copying_migrations_to_non_existing_directory @migrations_path = MIGRATIONS_ROOT + "/non_existing" @existing_migrations = [] |