Methods
S
T
Instance Public methods
setup()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 215
def setup
  @configurations = {:development => {'database' => 'my-db'}}

  ActiveRecord::Base.stubs(:configurations).returns(@configurations)
end
test_drops_configurations_with_blank_hosts()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 262
def test_drops_configurations_with_blank_hosts
  @configurations[:development].merge!('host' => nil)

  ActiveRecord::Tasks::DatabaseTasks.expects(:drop)

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end
test_drops_configurations_with_local_host()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 254
def test_drops_configurations_with_local_host
  @configurations[:development].merge!('host' => 'localhost')

  ActiveRecord::Tasks::DatabaseTasks.expects(:drop)

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end
test_drops_configurations_with_local_ip()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 246
def test_drops_configurations_with_local_ip
  @configurations[:development].merge!('host' => '127.0.0.1')

  ActiveRecord::Tasks::DatabaseTasks.expects(:drop)

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end
test_ignores_configurations_without_databases()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 221
def test_ignores_configurations_without_databases
  @configurations[:development].merge!('database' => nil)

  ActiveRecord::Tasks::DatabaseTasks.expects(:drop).never

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end
test_ignores_remote_databases()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 229
def test_ignores_remote_databases
  @configurations[:development].merge!('host' => 'my.server.tld')
  $stderr.stubs(:puts).returns(nil)

  ActiveRecord::Tasks::DatabaseTasks.expects(:drop).never

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end
test_warning_for_remote_databases()
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 238
def test_warning_for_remote_databases
  @configurations[:development].merge!('host' => 'my.server.tld')

  $stderr.expects(:puts).with('This task only modifies local databases. my-db is on a remote host.')

  ActiveRecord::Tasks::DatabaseTasks.drop_all
end