Skip to content

Instantly share code, notes, and snippets.

@elle
Created December 17, 2013 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elle/7998685 to your computer and use it in GitHub Desktop.
Save elle/7998685 to your computer and use it in GitHub Desktop.
We use Rake::TestTask to create a new task. This task will also run the db:test:prepare task so that we don’t need to worry about running it manually when we create further migrations. The code for this task adds the test directory to the load paths and then runs any file under the test directory whose filename ends in _test.rb. Finally we set t…
# /lib/tasks/minitest.rake
require "rake/testtask"
Rake::TestTask.new(:test => "db:test:prepare") do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end
task :default => :test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment