Skip to content
Browse files

test code that finds migrations

  • Loading branch information...
1 parent dea59f0 commit 6e7ba44f831e3c7c160f94dafaf854e2ea49bda8 @tenderlove tenderlove committed Jan 12, 2012
View
4 activerecord/test/cases/migration/rename_column_test.rb
@@ -186,6 +186,10 @@ def test_change_column_default_to_null
connection.change_column_default "test_models", "first_name", nil
assert_nil TestModel.new.first_name
end
+
+ def test_remove_column_no_second_parameter_raises_exception
+ assert_raise(ArgumentError) { connection.remove_column("funny") }
+ end
end
end
end
View
7 activerecord/test/cases/migration_test.rb
@@ -91,10 +91,6 @@ def drop_table; raise "no"; end
Person.connection.drop_table :testings2 rescue nil
end
- def test_remove_column_no_second_parameter_raises_exception
- assert_raise(ArgumentError) { Person.connection.remove_column("funny") }
- end
-
def test_add_table
assert !Reminder.table_exists?
@@ -315,8 +311,7 @@ def migrate(x); raise 'Something broke'; end
end
def test_finds_migrations
- list = ActiveRecord::Migrator.migrations(MIGRATIONS_ROOT + "/valid")
- migrations = ActiveRecord::Migrator.new(:up, list).migrations
+ migrations = ActiveRecord::Migrator.migrations(MIGRATIONS_ROOT + "/valid")
[[1, 'ValidPeopleHaveLastNames'], [2, 'WeNeedReminders'], [3, 'InnocentJointable']].each_with_index do |pair, i|
assert_equal migrations[i].version, pair.first

0 comments on commit 6e7ba44

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