diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-03-27 17:07:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 17:07:56 -0400 |
commit | 8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b (patch) | |
tree | a865ce4d154c06dc845e2ebe38045bba511bd4ee /activerecord/test/cases/tasks/database_tasks_test.rb | |
parent | 13683546b8fe7be34b3b094d10ab166561c1ecb4 (diff) | |
parent | 14739b5e27987e1eee080579fa0c80eea07347b8 (diff) | |
download | rails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.tar.gz rails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.tar.bz2 rails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.zip |
Merge pull request #28485 from quantumlicht/fix_migrate_with_empty_version
fix migrate with empty version
Diffstat (limited to 'activerecord/test/cases/tasks/database_tasks_test.rb')
-rw-r--r-- | activerecord/test/cases/tasks/database_tasks_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb index 5653fd83fd..baa41a3a47 100644 --- a/activerecord/test/cases/tasks/database_tasks_test.rb +++ b/activerecord/test/cases/tasks/database_tasks_test.rb @@ -350,6 +350,14 @@ module ActiveRecord ENV["VERBOSE"], ENV["VERSION"] = verbose, version end + def test_migrate_raise_error_on_empty_version + version = ENV["VERSION"] + ENV["VERSION"] = "" + assert_raise(RuntimeError, "Empty VERSION provided") { ActiveRecord::Tasks::DatabaseTasks.migrate } + ensure + ENV["VERSION"] = version + end + def test_migrate_clears_schema_cache_afterward ActiveRecord::Base.expects(:clear_cache!) ActiveRecord::Tasks::DatabaseTasks.migrate |