diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2018-12-27 18:16:40 +0200 |
---|---|---|
committer | Genadi Samokovarov <gsamokovarov@gmail.com> | 2019-04-19 14:14:06 +0900 |
commit | 255a2422a3082fc1c194610ab43c08e755d16c9a (patch) | |
tree | 1e986babfa826d29295351c6841c2b32ace6f6a8 /activerecord/test | |
parent | 45f1c7a3e16437e517baa6606674f7bbb16dba74 (diff) | |
download | rails-255a2422a3082fc1c194610ab43c08e755d16c9a.tar.gz rails-255a2422a3082fc1c194610ab43c08e755d16c9a.tar.bz2 rails-255a2422a3082fc1c194610ab43c08e755d16c9a.zip |
Make ActiveRecord::PendingMigrationError actionable
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/tasks/database_tasks_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb index dd4a0b0455..ffe94eee0f 100644 --- a/activerecord/test/cases/tasks/database_tasks_test.rb +++ b/activerecord/test/cases/tasks/database_tasks_test.rb @@ -760,7 +760,7 @@ module ActiveRecord end class DatabaseTasksMigrateTest < DatabaseTasksMigrationTestCase - def test_migrate_set_and_unset_verbose_and_version_env_vars + def test_can_migrate_from_pending_migration_error_action_dispatch verbose, version = ENV["VERBOSE"], ENV["VERSION"] ENV["VERSION"] = "2" ENV["VERBOSE"] = "false" @@ -772,7 +772,9 @@ module ActiveRecord ENV.delete("VERBOSE") # re-run up migration - assert_includes capture_migration_output, "migrating" + assert_includes(capture(:stdout) do + ActiveSupport::ActionableError.dispatch ActiveRecord::PendingMigrationError, "Run pending migrations" + end, "migrating") ensure ENV["VERBOSE"], ENV["VERSION"] = verbose, version end |