aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migrator_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-16 11:28:00 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-16 11:28:00 -0800
commit247d274cabae827766c1c5b9deb34fb34548fc5e (patch)
treec34fe6ab1d0ebe5e7df46dd8660caccd4fd79e3c /activerecord/test/cases/migrator_test.rb
parent536433845d1d13b46483beac6bb5e7ba91008d2a (diff)
downloadrails-247d274cabae827766c1c5b9deb34fb34548fc5e.tar.gz
rails-247d274cabae827766c1c5b9deb34fb34548fc5e.tar.bz2
rails-247d274cabae827766c1c5b9deb34fb34548fc5e.zip
moving verbosity tests to the migrator test, removing ddl changes
Diffstat (limited to 'activerecord/test/cases/migrator_test.rb')
-rw-r--r--activerecord/test/cases/migrator_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb
index 5553798cc7..bb507c635a 100644
--- a/activerecord/test/cases/migrator_test.rb
+++ b/activerecord/test/cases/migrator_test.rb
@@ -221,6 +221,30 @@ module ActiveRecord
assert_equal(0, ActiveRecord::Migrator.current_version)
end
+ def test_migrator_verbosity
+ _, migrations = sensors(3)
+
+ ActiveRecord::Migrator.new(:up, migrations, 1).migrate
+ assert_not_equal 0, ActiveRecord::Migration.message_count
+
+ ActiveRecord::Migration.message_count = 0
+
+ ActiveRecord::Migrator.new(:down, migrations, 0).migrate
+ assert_not_equal 0, ActiveRecord::Migration.message_count
+ ActiveRecord::Migration.message_count = 0
+ end
+
+ def test_migrator_verbosity_off
+ _, migrations = sensors(3)
+
+ ActiveRecord::Migration.message_count = 0
+ ActiveRecord::Migration.verbose = false
+ ActiveRecord::Migrator.new(:up, migrations, 1).migrate
+ assert_equal 0, ActiveRecord::Migration.message_count
+ ActiveRecord::Migrator.new(:down, migrations, 0).migrate
+ assert_equal 0, ActiveRecord::Migration.message_count
+ end
+
private
def m(name, version, &block)
x = Sensor.new name, version