aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/tasks/database_tasks_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/tasks/database_tasks_test.rb')
-rw-r--r--activerecord/test/cases/tasks/database_tasks_test.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb
index baa41a3a47..b4983624ba 100644
--- a/activerecord/test/cases/tasks/database_tasks_test.rb
+++ b/activerecord/test/cases/tasks/database_tasks_test.rb
@@ -343,8 +343,23 @@ module ActiveRecord
ENV["VERBOSE"] = "false"
ENV["VERSION"] = "4"
-
ActiveRecord::Migrator.expects(:migrate).with("custom/path", 4)
+ ActiveRecord::Migration.expects(:verbose=).with(false)
+ ActiveRecord::Migration.expects(:verbose=).with(ActiveRecord::Migration.verbose)
+ ActiveRecord::Tasks::DatabaseTasks.migrate
+
+ ENV.delete("VERBOSE")
+ ENV.delete("VERSION")
+ ActiveRecord::Migrator.expects(:migrate).with("custom/path", nil)
+ ActiveRecord::Migration.expects(:verbose=).with(true)
+ ActiveRecord::Migration.expects(:verbose=).with(ActiveRecord::Migration.verbose)
+ ActiveRecord::Tasks::DatabaseTasks.migrate
+
+ ENV["VERBOSE"] = "yes"
+ ENV["VERSION"] = "unknown"
+ ActiveRecord::Migrator.expects(:migrate).with("custom/path", 0)
+ ActiveRecord::Migration.expects(:verbose=).with(true)
+ ActiveRecord::Migration.expects(:verbose=).with(ActiveRecord::Migration.verbose)
ActiveRecord::Tasks::DatabaseTasks.migrate
ensure
ENV["VERBOSE"], ENV["VERSION"] = verbose, version