2010-10-15 07:53:33 -04:00
|
|
|
require 'bundler'
|
|
|
|
Bundler::GemHelper.install_tasks
|
2010-10-12 08:15:56 -04:00
|
|
|
|
2014-03-20 16:17:11 -04:00
|
|
|
desc 'Set a relevant database.yml for testing'
|
2014-03-14 16:11:10 -04:00
|
|
|
task :prepare do
|
|
|
|
ENV["DB"] ||= "sqlite"
|
2015-12-13 01:14:59 -05:00
|
|
|
FileUtils.cp "test/dummy/config/database.#{ENV["DB"]}.yml", "test/dummy/config/database.yml"
|
2014-03-14 16:11:10 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2014-03-20 16:17:11 -04:00
|
|
|
require 'rake/testtask'
|
2013-08-27 15:12:33 -04:00
|
|
|
desc 'Run tests on PaperTrail with Test::Unit.'
|
2009-05-27 11:21:20 -04:00
|
|
|
Rake::TestTask.new(:test) do |t|
|
|
|
|
t.libs << 'lib'
|
|
|
|
t.libs << 'test'
|
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2011-02-08 12:16:35 -05:00
|
|
|
t.verbose = false
|
2009-05-27 11:21:20 -04:00
|
|
|
end
|
|
|
|
|
2013-08-27 15:12:33 -04:00
|
|
|
require 'rspec/core/rake_task'
|
2015-02-17 15:36:04 -05:00
|
|
|
desc 'Run tests on PaperTrail with RSpec'
|
2013-08-27 15:12:33 -04:00
|
|
|
RSpec::Core::RakeTask.new(:spec)
|
|
|
|
|
2015-11-27 21:16:37 -05:00
|
|
|
require 'rubocop/rake_task'
|
|
|
|
RuboCop::RakeTask.new
|
|
|
|
|
2013-08-30 16:14:22 -04:00
|
|
|
desc 'Default: run all available test suites'
|
2015-11-27 21:16:37 -05:00
|
|
|
task :default => [:rubocop, :prepare, :test, :spec]
|