aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/tasks/database_tasks_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb
index da7ca27f13..21226352ff 100644
--- a/activerecord/test/cases/tasks/database_tasks_test.rb
+++ b/activerecord/test/cases/tasks/database_tasks_test.rb
@@ -124,6 +124,14 @@ module ActiveRecord
ActiveRecord::Base.connection_handler.stubs(:establish_connection)
end
+ def test_ignores_configurations_without_databases
+ @configurations["development"].merge!("database" => nil)
+
+ ActiveRecord::Tasks::DatabaseTasks.expects(:create).never
+
+ ActiveRecord::Tasks::DatabaseTasks.create_all
+ end
+
def test_ignores_remote_databases
@configurations["development"].merge!("host" => "my.server.tld")
$stderr.stubs(:puts).returns(nil)
@@ -242,6 +250,14 @@ module ActiveRecord
ActiveRecord::Base.stubs(:configurations).returns(@configurations)
end
+ def test_ignores_configurations_without_databases
+ @configurations[:development].merge!("database" => nil)
+
+ ActiveRecord::Tasks::DatabaseTasks.expects(:drop).never
+
+ ActiveRecord::Tasks::DatabaseTasks.drop_all
+ end
+
def test_ignores_remote_databases
@configurations[:development].merge!("host" => "my.server.tld")
$stderr.stubs(:puts).returns(nil)