2008-05-31 17:46:33 +00:00
|
|
|
require 'rubygems'
|
2011-11-11 15:23:10 +00:00
|
|
|
require 'bundler'
|
2008-05-28 22:40:32 +00:00
|
|
|
require 'rake'
|
2010-11-11 21:23:15 +00:00
|
|
|
require 'appraisal'
|
2011-02-07 22:48:00 +00:00
|
|
|
require 'yard'
|
2011-11-11 15:23:10 +00:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
require 'cucumber/rake/task'
|
|
|
|
|
2017-10-20 19:20:28 +00:00
|
|
|
Bundler::GemHelper.install_tasks(name: 'factory_bot')
|
2008-05-28 22:40:32 +00:00
|
|
|
|
2009-09-15 19:56:54 +00:00
|
|
|
desc 'Default: run the specs and features.'
|
2016-02-05 15:40:58 +00:00
|
|
|
task default: %w(spec:unit spec:acceptance features)
|
2009-04-11 15:27:23 +00:00
|
|
|
|
2010-06-10 17:37:51 +00:00
|
|
|
namespace :spec do
|
|
|
|
desc "Run unit specs"
|
2010-11-11 21:33:45 +00:00
|
|
|
RSpec::Core::RakeTask.new('unit') do |t|
|
2017-10-20 19:20:28 +00:00
|
|
|
t.pattern = 'spec/{*_spec.rb,factory_bot/**/*_spec.rb}'
|
2010-06-10 17:37:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Run acceptance specs"
|
2010-11-11 21:33:45 +00:00
|
|
|
RSpec::Core::RakeTask.new('acceptance') do |t|
|
|
|
|
t.pattern = 'spec/acceptance/**/*_spec.rb'
|
2010-06-10 17:37:51 +00:00
|
|
|
end
|
2008-05-28 22:40:32 +00:00
|
|
|
end
|
|
|
|
|
2010-06-10 17:37:51 +00:00
|
|
|
desc "Run the unit and acceptance specs"
|
2018-10-07 22:02:54 +00:00
|
|
|
task spec: ['spec:unit', 'spec:acceptance']
|
2010-06-10 17:37:51 +00:00
|
|
|
|
2009-09-15 19:56:54 +00:00
|
|
|
Cucumber::Rake::Task.new(:features) do |t|
|
|
|
|
t.fork = true
|
|
|
|
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
|
|
|
end
|
2010-06-23 14:59:11 +00:00
|
|
|
|
2011-02-07 22:48:00 +00:00
|
|
|
YARD::Rake::YardocTask.new do |t|
|
|
|
|
end
|