Skip to content

Instantly share code, notes, and snippets.

@camelpunch
Created August 15, 2010 20:21
Show Gist options
  • Select an option

  • Save camelpunch/525914 to your computer and use it in GitHub Desktop.

Select an option

Save camelpunch/525914 to your computer and use it in GitHub Desktop.
task :cruise => [:copy_database_config] do
RAILS_ENV = 'test'
Rake::Task['db:drop'].invoke
Rake::Task['db:create'].invoke
Rake::Task['db:schema:load'].invoke
Rake::Task['spec'].prerequisites.clear
Rake::Task['spec'].invoke
FileUtils.rm_f(File.dirname(__FILE__) + '/../../rerun.txt')
Rake::Task['cucumber:ok'].prerequisites.clear
Rake::Task['cucumber:ok'].invoke
end
task :copy_database_config do
File.open(File.dirname(__FILE__) + '/../../config/database.yml', 'w') do |file|
file << <<YAML
test: &TEST
adapter: mysql
encoding: utf8
reconnect: false
pool: 5
host: some.host
database: test_database
username: test_username
password: test_password
cucumber:
<<: *TEST
YAML
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment