-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
47 lines (39 loc) · 1.12 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
47
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
pwd = File.expand_path('../', __FILE__)
gemfiles = Dir.glob(File.join(pwd, "gemfiles", "*.gemfile")).map { |f| File.basename(f, ".*") }
namespace :spec do
gemfiles.each do |gemfile|
desc "Run Tests by #{gemfile}.gemfile"
task gemfile do
Bundler.with_clean_env do
sh "BUNDLE_GEMFILE='#{pwd}/gemfiles/#{gemfile}.gemfile' bundle install --path #{pwd}/.bundle"
sh "BUNDLE_GEMFILE='#{pwd}/gemfiles/#{gemfile}.gemfile' bundle exec rake -t spec"
end
end
end
desc "Run All Tests"
task :all do
gemfiles.each do |gemfile|
Rake::Task["spec:#{gemfile}"].invoke
end
end
end
namespace :bundle_update do
gemfiles.each do |gemfile|
desc "Run Tests by #{gemfile}.gemfile"
task gemfile do
Bundler.with_clean_env do
sh "BUNDLE_GEMFILE='#{pwd}/gemfiles/#{gemfile}.gemfile' bundle update"
end
end
end
desc "Run All Tests"
task :all do
gemfiles.each do |gemfile|
Rake::Task["bundle_update:#{gemfile}"].invoke
end
end
end