diff options
Diffstat (limited to 'activerecord/test/cases/invertible_migration_test.rb')
-rw-r--r-- | activerecord/test/cases/invertible_migration_test.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/activerecord/test/cases/invertible_migration_test.rb b/activerecord/test/cases/invertible_migration_test.rb index aba854820b..9d5aace7db 100644 --- a/activerecord/test/cases/invertible_migration_test.rb +++ b/activerecord/test/cases/invertible_migration_test.rb @@ -6,7 +6,7 @@ end module ActiveRecord class InvertibleMigrationTest < ActiveRecord::TestCase class SilentMigration < ActiveRecord::Migration::Current - def write(text = '') + def write(text = "") # sssshhhhh!! end end @@ -225,7 +225,7 @@ module ActiveRecord InvertibleMigration.new.migrate :up received = [] migration = InvertibleByPartsMigration.new - migration.test = ->(dir){ + migration.test = ->(dir) { ActiveSupport::Deprecation.silence do assert migration.connection.table_exists?("horses") assert migration.connection.table_exists?("new_horses") @@ -291,21 +291,21 @@ module ActiveRecord migration1.migrate(:up) migration2.migrate(:up) - assert_equal true, Horse.connection.extension_enabled?('hstore') + assert_equal true, Horse.connection.extension_enabled?("hstore") migration3.migrate(:up) - assert_equal false, Horse.connection.extension_enabled?('hstore') + assert_equal false, Horse.connection.extension_enabled?("hstore") migration3.migrate(:down) - assert_equal true, Horse.connection.extension_enabled?('hstore') + assert_equal true, Horse.connection.extension_enabled?("hstore") migration2.migrate(:down) - assert_equal false, Horse.connection.extension_enabled?('hstore') + assert_equal false, Horse.connection.extension_enabled?("hstore") end end def test_revert_order - block = Proc.new{|t| t.string :name } + block = Proc.new { |t| t.string :name } recorder = ActiveRecord::Migration::CommandRecorder.new(ActiveRecord::Base.connection) recorder.instance_eval do create_table("apples", &block) @@ -351,14 +351,14 @@ module ActiveRecord end def test_migrate_down_with_table_name_prefix - ActiveRecord::Base.table_name_prefix = 'p_' - ActiveRecord::Base.table_name_suffix = '_s' + ActiveRecord::Base.table_name_prefix = "p_" + ActiveRecord::Base.table_name_suffix = "_s" migration = InvertibleMigration.new migration.migrate(:up) assert_nothing_raised { migration.migrate(:down) } ActiveSupport::Deprecation.silence { assert !ActiveRecord::Base.connection.table_exists?("p_horses_s"), "p_horses_s should not exist" } ensure - ActiveRecord::Base.table_name_prefix = ActiveRecord::Base.table_name_suffix = '' + ActiveRecord::Base.table_name_prefix = ActiveRecord::Base.table_name_suffix = "" end def test_migrations_can_handle_foreign_keys_to_specific_tables @@ -382,6 +382,5 @@ module ActiveRecord "horses_index_named index should not exist" end end - end end |