diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 11:04:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 14:33:58 -0800 |
commit | 0f743bc59dc04f9108cefb46e22a56ed7ebf35bc (patch) | |
tree | 3c940aaa0de52dca5a6132b29b56f763d2e6f321 /activerecord/test | |
parent | d0bb43d621c471659d03504f48f0197c0ae3b57c (diff) | |
download | rails-0f743bc59dc04f9108cefb46e22a56ed7ebf35bc.tar.gz rails-0f743bc59dc04f9108cefb46e22a56ed7ebf35bc.tar.bz2 rails-0f743bc59dc04f9108cefb46e22a56ed7ebf35bc.zip |
move schema dumper tests to the correct class
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 9 | ||||
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index dfe55cfb16..1db7dab04b 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -310,15 +310,6 @@ class MigrationTest < ActiveRecord::TestCase 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) diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index 724632489b..9abc363546 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -14,6 +14,16 @@ class SchemaDumperTest < ActiveRecord::TestCase @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 |