From 6e7ba44f831e3c7c160f94dafaf854e2ea49bda8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 12 Jan 2012 15:43:41 -0800 Subject: [PATCH] test code that finds migrations --- activerecord/test/cases/migration/rename_column_test.rb | 4 ++++ activerecord/test/cases/migration_test.rb | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/activerecord/test/cases/migration/rename_column_test.rb b/activerecord/test/cases/migration/rename_column_test.rb index a9157797e4..2e7e533ed6 100644 --- a/activerecord/test/cases/migration/rename_column_test.rb +++ b/activerecord/test/cases/migration/rename_column_test.rb @@ -186,6 +186,10 @@ module ActiveRecord 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 diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 1d1a9a221a..02453edcda 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -91,10 +91,6 @@ class MigrationTest < ActiveRecord::TestCase 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 @@ class MigrationTest < ActiveRecord::TestCase 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