2011-11-18 18:13:04 -05:00
|
|
|
require 'bundler/setup'
|
2011-11-12 17:04:59 -05:00
|
|
|
require 'bundler/gem_tasks'
|
2010-12-13 17:28:59 -05:00
|
|
|
require 'rspec/core/rake_task'
|
2011-05-25 14:38:07 -04:00
|
|
|
require 'appraisal'
|
2015-01-23 13:50:04 -05:00
|
|
|
require_relative 'tasks/documentation'
|
2015-02-08 16:38:55 -05:00
|
|
|
require_relative 'spec/support/tests/database'
|
2015-10-28 20:39:46 -04:00
|
|
|
require_relative 'spec/support/tests/current_bundle'
|
2014-04-04 13:11:46 -04:00
|
|
|
|
2014-10-26 20:51:42 -04:00
|
|
|
RSpec::Core::RakeTask.new('spec:unit') do |t|
|
2014-06-27 18:39:39 -04:00
|
|
|
t.ruby_opts = '-w -r ./spec/report_warnings'
|
2020-09-04 10:38:31 -04:00
|
|
|
t.pattern = 'spec/unit/**/*_spec.rb'
|
2010-12-14 18:35:12 -05:00
|
|
|
t.rspec_opts = '--color --format progress'
|
|
|
|
t.verbose = false
|
2010-12-13 17:28:59 -05:00
|
|
|
end
|
|
|
|
|
2014-10-26 20:52:55 -04:00
|
|
|
RSpec::Core::RakeTask.new('spec:acceptance') do |t|
|
|
|
|
t.ruby_opts = '-w -r ./spec/report_warnings'
|
2020-09-04 10:38:31 -04:00
|
|
|
t.pattern = 'spec/acceptance/**/*_spec.rb'
|
2014-10-26 20:52:55 -04:00
|
|
|
t.rspec_opts = '--color --format progress'
|
|
|
|
t.verbose = false
|
|
|
|
end
|
|
|
|
|
2014-01-20 13:35:10 -05:00
|
|
|
task :default do
|
2015-10-28 20:39:46 -04:00
|
|
|
if Tests::CurrentBundle.instance.appraisal_in_use?
|
2015-12-13 21:44:29 -05:00
|
|
|
sh 'rake spec:unit --trace'
|
|
|
|
sh 'rake spec:acceptance --trace'
|
2013-03-04 16:10:54 -05:00
|
|
|
else
|
2015-10-28 20:39:46 -04:00
|
|
|
if ENV['CI']
|
2020-09-04 10:38:31 -04:00
|
|
|
exec 'appraisal install && appraisal rake --trace'
|
2015-10-28 20:39:46 -04:00
|
|
|
else
|
|
|
|
appraisal = Tests::CurrentBundle.instance.latest_appraisal
|
2015-12-13 21:44:29 -05:00
|
|
|
exec "appraisal install && appraisal #{appraisal} rake --trace"
|
2015-10-28 20:39:46 -04:00
|
|
|
end
|
2013-03-04 16:10:54 -05:00
|
|
|
end
|
2011-05-25 14:38:07 -04:00
|
|
|
end
|
2012-04-10 00:06:09 -04:00
|
|
|
|
2018-01-24 01:02:06 -05:00
|
|
|
namespace :appraisal do
|
|
|
|
task :list do
|
|
|
|
appraisals = Tests::CurrentBundle.instance.available_appraisals
|
|
|
|
puts "Valid appraisals: #{appraisals.join(', ')}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-01-23 13:50:04 -05:00
|
|
|
Shoulda::Matchers::DocumentationTasks.create
|
2014-04-04 13:11:46 -04:00
|
|
|
|
|
|
|
task release: 'docs:publish_latest'
|