Permalink
Browse files

clear the rest of the warnings, run with warnings turned on [#4332 st…

…ate:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 922e4c5 commit f46dc9b6b706d8fbbb37d9d6374e671a633bff9f @tenderlove tenderlove committed with josevalim Apr 6, 2010
Showing with 40 additions and 25 deletions.
  1. +1 −0 activerecord/Rakefile
  2. +39 −25 activerecord/test/cases/migration_test.rb
View
@@ -50,6 +50,7 @@ end
t.libs << "test" << connection_path
t.test_files=Dir.glob( "test/cases/**/*_test{,_#{adapter_short}}.rb" ).sort
t.verbose = true
+ t.warning = true
}
task "isolated_test_#{adapter}" do
@@ -1136,21 +1136,6 @@ def test_only_loads_pending_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 @@ def test_create_table_with_custom_sequence_name
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 @@ def with_new_table
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

0 comments on commit f46dc9b

Please sign in to comment.