diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-04-06 00:18:22 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-10 13:50:38 +0200 |
commit | f46dc9b6b706d8fbbb37d9d6374e671a633bff9f (patch) | |
tree | bb12b257e2f0ef99510d0446656ca77adbf32a74 /activerecord/test/cases/migration_test.rb | |
parent | 922e4c57a4a8efe5b045cf800692c487cbacb93c (diff) | |
download | rails-f46dc9b6b706d8fbbb37d9d6374e671a633bff9f.tar.gz rails-f46dc9b6b706d8fbbb37d9d6374e671a633bff9f.tar.bz2 rails-f46dc9b6b706d8fbbb37d9d6374e671a633bff9f.zip |
clear the rest of the warnings, run with warnings turned on [#4332 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 64 |
1 files changed, 39 insertions, 25 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index e213986ede..7a26ee072d 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1136,21 +1136,6 @@ if ActiveRecord::Base.connection.supports_migrations? load(MIGRATIONS_ROOT + "/valid/1_people_have_last_names.rb") end - def test_migrator_interleaved_migrations - ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_1") - - assert_nothing_raised do - ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2") - end - - Person.reset_column_information - assert Person.column_methods_hash.include?(:last_name) - - assert_nothing_raised do - ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/interleaved/pass_3") - end - end - def test_migrator_db_has_no_schema_migrations_table # Oracle adapter raises error if semicolon is present as last character if current_adapter?(:OracleAdapter) @@ -1362,16 +1347,6 @@ if ActiveRecord::Base.connection.supports_migrations? end end - def test_migration_should_be_run_without_logger - previous_logger = ActiveRecord::Base.logger - ActiveRecord::Base.logger = nil - assert_nothing_raised do - ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid") - end - ensure - ActiveRecord::Base.logger = previous_logger - end - protected def with_env_tz(new_tz = 'US/Eastern') old_tz, ENV['TZ'] = ENV['TZ'], new_tz @@ -1457,6 +1432,45 @@ if ActiveRecord::Base.connection.supports_migrations? end # SexyMigrationsTest + class MigrationLoggerTest < ActiveRecord::TestCase + def setup + Object.send(:remove_const, :InnocentJointable) + end + + def test_migration_should_be_run_without_logger + previous_logger = ActiveRecord::Base.logger + ActiveRecord::Base.logger = nil + assert_nothing_raised do + ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid") + end + ensure + ActiveRecord::Base.logger = previous_logger + end + end + + class InterleavedMigrationsTest < ActiveRecord::TestCase + def setup + Object.send(:remove_const, :PeopleHaveLastNames) + end + + def test_migrator_interleaved_migrations + ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_1") + + assert_nothing_raised do + ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2") + end + + Person.reset_column_information + assert Person.column_methods_hash.include?(:last_name) + + Object.send(:remove_const, :PeopleHaveLastNames) + Object.send(:remove_const, :InnocentJointable) + assert_nothing_raised do + ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/interleaved/pass_3") + end + end + end + class ChangeTableMigrationsTest < ActiveRecord::TestCase def setup @connection = Person.connection |