diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-04-26 20:34:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 20:34:38 -0700 |
commit | 3090017c6310b2eca5de3770e4a84d0cfa0d781e (patch) | |
tree | 37c13a428ed01b58989c2925745291be5aeb0def /activerecord/test | |
parent | f680664d4e2f81216ee73c047b836d49a796234c (diff) | |
parent | f50e143b77051428a2dbb8822603ffd730230e1f (diff) | |
download | rails-3090017c6310b2eca5de3770e4a84d0cfa0d781e.tar.gz rails-3090017c6310b2eca5de3770e4a84d0cfa0d781e.tar.bz2 rails-3090017c6310b2eca5de3770e4a84d0cfa0d781e.zip |
Merge pull request #28881 from bogdanvlviv/verbose-migration
Set consistent typecast ENV["VERBOSE"]
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/tasks/database_tasks_test.rb | 17 |
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 |