From 87124457e55a207e190fc8dc981c2dc68445c736 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 19 Nov 2010 10:55:57 -0800 Subject: fisting my spelling errors --- .../test/cases/invertable_migration_test.rb | 57 ---------------------- .../test/cases/invertible_migration_test.rb | 57 ++++++++++++++++++++++ 2 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 activerecord/test/cases/invertable_migration_test.rb create mode 100644 activerecord/test/cases/invertible_migration_test.rb (limited to 'activerecord') diff --git a/activerecord/test/cases/invertable_migration_test.rb b/activerecord/test/cases/invertable_migration_test.rb deleted file mode 100644 index b4c1dccb22..0000000000 --- a/activerecord/test/cases/invertable_migration_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -require "cases/helper" - -module ActiveRecord - class InvertableMigrationTest < ActiveRecord::TestCase - class SilentMigration < ActiveRecord::Migration - def write(text = '') - # sssshhhhh!! - end - end - - class InvertableMigration < SilentMigration - def change - create_table("horses") do |t| - t.column :content, :text - t.column :remind_at, :datetime - end - end - end - - class NonInvertableMigration < SilentMigration - def change - create_table("horses") do |t| - t.column :content, :text - t.column :remind_at, :datetime - end - remove_column "horses", :content - end - end - - def treardown - if ActiveRecord::Base.connection.table_exists?("horses") - ActiveRecord::Base.connection.drop_table("horses") - end - end - - def test_no_reverse - migration = NonInvertableMigration.new - migration.migrate(:up) - assert_raises(IrreversibleMigration) do - migration.migrate(:down) - end - end - - def test_up - migration = InvertableMigration.new - migration.migrate(:up) - assert migration.connection.table_exists?("horses"), "horses should exist" - end - - def test_down - migration = InvertableMigration.new - migration.migrate :up - migration.migrate :down - assert !migration.connection.table_exists?("horses") - end - end -end diff --git a/activerecord/test/cases/invertible_migration_test.rb b/activerecord/test/cases/invertible_migration_test.rb new file mode 100644 index 0000000000..7e61ab0e47 --- /dev/null +++ b/activerecord/test/cases/invertible_migration_test.rb @@ -0,0 +1,57 @@ +require "cases/helper" + +module ActiveRecord + class InvertibleMigrationTest < ActiveRecord::TestCase + class SilentMigration < ActiveRecord::Migration + def write(text = '') + # sssshhhhh!! + end + end + + class InvertibleMigration < SilentMigration + def change + create_table("horses") do |t| + t.column :content, :text + t.column :remind_at, :datetime + end + end + end + + class NonInvertibleMigration < SilentMigration + def change + create_table("horses") do |t| + t.column :content, :text + t.column :remind_at, :datetime + end + remove_column "horses", :content + end + end + + def treardown + if ActiveRecord::Base.connection.table_exists?("horses") + ActiveRecord::Base.connection.drop_table("horses") + end + end + + def test_no_reverse + migration = NonInvertibleMigration.new + migration.migrate(:up) + assert_raises(IrreversibleMigration) do + migration.migrate(:down) + end + end + + def test_up + migration = InvertibleMigration.new + migration.migrate(:up) + assert migration.connection.table_exists?("horses"), "horses should exist" + end + + def test_down + migration = InvertibleMigration.new + migration.migrate :up + migration.migrate :down + assert !migration.connection.table_exists?("horses") + end + end +end -- cgit v1.2.3