Skip to content

Instantly share code, notes, and snippets.

@allaire
Last active December 15, 2015 16:19
Show Gist options
  • Save allaire/5288696 to your computer and use it in GitHub Desktop.
Save allaire/5288696 to your computer and use it in GitHub Desktop.
Rakefile
require 'rake/testtask'
Rake::TestTask.new('test:models' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/models/**/*_test.rb'
end
Rake::TestTask.new('test:controllers' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/controllers/**/*_test.rb'
end
Rake::TestTask.new('test:features' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/features/**/*_test.rb'
end
Rake::TestTask.new('test:jobs' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/jobs/**/*_test.rb'
end
Rake::TestTask.new('test:libraries' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/libraries/**/*_test.rb'
end
Rake::TestTask.new('test:mailers' => ['db:test:prepare', 'db:seed']) do |t|
t.pattern = 'test/mailers/**/*_test.rb'
end
Rake::TestTask.new('test' => ['db:test:prepare', 'db:seed']) do |t|
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