Skip to content
Browse files

move schema dumper tests to the correct class

  • Loading branch information...
1 parent d0bb43d commit 0f743bc59dc04f9108cefb46e22a56ed7ebf35bc @tenderlove tenderlove committed Jan 13, 2012
Showing with 10 additions and 9 deletions.
  1. +0 −9 activerecord/test/cases/migration_test.rb
  2. +10 −0 activerecord/test/cases/schema_dumper_test.rb
View
9 activerecord/test/cases/migration_test.rb
@@ -310,15 +310,6 @@ def migrate(x); raise 'Something broke'; end
refute Person.column_methods_hash.include?(:last_name)
end
- def test_dump_schema_information_outputs_lexically_ordered_versions
- migration_path = MIGRATIONS_ROOT + '/valid_with_timestamps'
- ActiveRecord::Migrator.run(:up, migration_path, 20100301010101)
- ActiveRecord::Migrator.run(:up, migration_path, 20100201010101)
-
- schema_info = ActiveRecord::Base.connection.dump_schema_information
- assert_match(/20100201010101.*20100301010101/m, schema_info)
- end
-
def test_only_loads_pending_migrations
# migrate up to 1
ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/valid", 1)
View
10 activerecord/test/cases/schema_dumper_test.rb
@@ -14,6 +14,16 @@ def standard_dump
@stream.string
end
+ def test_dump_schema_information_outputs_lexically_ordered_versions
+ versions = %w{ 20100101010101 20100201010101 20100301010101 }
+ versions.reverse.each do |v|
+ ActiveRecord::SchemaMigration.create!(:version => v)
+ end
+
+ schema_info = ActiveRecord::Base.connection.dump_schema_information
+ assert_match(/20100201010101.*20100301010101/m, schema_info)
+ end
+
def test_magic_comment
assert_match "# encoding: #{@stream.external_encoding.name}", standard_dump
end

0 comments on commit 0f743bc

Please sign in to comment.
Something went wrong with that request. Please try again.