Created
November 12, 2009 18:38
-
-
Save ambethia/233150 to your computer and use it in GitHub Desktop.
Rake: Write out a database.yml with settings for a test environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
namespace :test do | |
desc "Write out a database.yml with settings for a test environment" | |
task :config do | |
File.open(Rails.root + "config/database.yml", "w") do |config| | |
config << <<-END_YAML.gsub(/^ {10}/, '') | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
test: | |
adapter: sqlite3 | |
database: db/test.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
END_YAML | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment