-
-
Notifications
You must be signed in to change notification settings - Fork 327
/
Rakefile
46 lines (36 loc) · 1.14 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# frozen_string_literal: true
require 'appraisal'
require 'pathname'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
Cucumber::Rake::Task.new
RSpec::Core::RakeTask.new
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
task default: :test
task test: %i[spec cucumber]
namespace :test do
desc 'Run tests against all gemfiles'
task :all do
Rake::Task['appraisal'].invoke('test')
end
desc 'Run tests against specified gemfile, e.g. rake test:gemfile[rails_6_0]'
task :gemfile, :name do |_task, args|
unless args.name && Pathname.new("gemfiles/#{args.name}.gemfile").exist?
raise ArgumentError, "You must provide the name of an existing Appraisal gemfile,
e.g. 'rake test:gemfile[rails_6_0]'"
end
Rake::Task["appraisal:#{args.name}"].invoke('test')
end
end
namespace :gemfiles do
desc 'Re-install dependencies for all gemfiles'
task :reinstall do
system 'bundle exec appraisal update'
end
desc 'Remove all generated gemfiles'
task :clean do
FileUtils.rm_rf('gemfiles/*')
end
desc 'Remove all generated gemfiles and re-install dependencies'
task rebuild: %i[clean reinstall]
end