Methods
- S
- T
Instance Public methods
setup()
Link
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 272 def setup @configurations = { 'development' => {'database' => 'dev-db'}, 'test' => {'database' => 'test-db'}, 'production' => {'database' => 'prod-db'} } ActiveRecord::Base.stubs(:configurations).returns(@configurations) end
test_drops_current_environment_database()
Link
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 282 def test_drops_current_environment_database ActiveRecord::Tasks::DatabaseTasks.expects(:drop). with('database' => 'prod-db') ActiveRecord::Tasks::DatabaseTasks.drop_current( ActiveSupport::StringInquirer.new('production') ) end
test_drops_test_and_development_databases_when_env_was_not_specified()
Link
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 291 def test_drops_test_and_development_databases_when_env_was_not_specified ActiveRecord::Tasks::DatabaseTasks.expects(:drop). with('database' => 'dev-db') ActiveRecord::Tasks::DatabaseTasks.expects(:drop). with('database' => 'test-db') ActiveRecord::Tasks::DatabaseTasks.drop_current( ActiveSupport::StringInquirer.new('development') ) end
test_drops_testand_development_databases_when_rails_env_is_development()
Link
# File activerecord/test/cases/tasks/database_tasks_test.rb, line 302 def test_drops_testand_development_databases_when_rails_env_is_development old_env = ENV['RAILS_ENV'] ENV['RAILS_ENV'] = 'development' ActiveRecord::Tasks::DatabaseTasks.expects(:drop). with('database' => 'dev-db') ActiveRecord::Tasks::DatabaseTasks.expects(:drop). with('database' => 'test-db') ActiveRecord::Tasks::DatabaseTasks.drop_current( ActiveSupport::StringInquirer.new('development') ) ensure ENV['RAILS_ENV'] = old_env end