Skip to content

Commit

Permalink
clear the rest of the warnings, run with warnings turned on [#4332 st…
Browse files Browse the repository at this point in the history
…ate:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
tenderlove authored and josevalim committed Apr 10, 2010
1 parent 922e4c5 commit f46dc9b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
1 change: 1 addition & 0 deletions activerecord/Rakefile
Expand Up @@ -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
Expand Down
64 changes: 39 additions & 25 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f46dc9b

Please sign in to comment.