Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created September 27, 2012 10:29
Show Gist options
  • Save pjb3/3793351 to your computer and use it in GitHub Desktop.
Save pjb3/3793351 to your computer and use it in GitHub Desktop.
Want to run all your tests at once in a rails app?

Append the contents of 'Rakefile' to your application's Rakefile.

Now when you run:

$ rake

You will see all tests, unit, functional and integration, run at one time, without reloading the environment between each set of tests. If you want to just run one set of tests, you can still do:

$ rake test:units
$ rake test:functionals
Rake.application.instance_variable_get('@tasks').delete('test')
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/**/*_test.rb']
end
task :test => "db:test:prepare"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment