-
Notifications
You must be signed in to change notification settings - Fork 74
/
Rakefile
57 lines (44 loc) · 1.31 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
48
49
50
51
52
53
54
55
56
57
require 'rake'
require 'bundler/gem_tasks'
begin
require 'gemika/tasks'
rescue LoadError
puts 'Run `gem install gemika` for additional tasks'
end
task default: 'matrix:spec'
task :spec do
success = system("bundle exec rspec spec --exclude-pattern '**/isolated/**'")
for_each_isolated_spec do |isolated_spec|
success &= system("bundle exec rspec #{isolated_spec}")
end
fail "Tests failed" unless success
end
# we have to override the matrix:spec task, since we need some specs to run in isolation
Rake::Task["matrix:spec"].clear
namespace :matrix do
desc "Run specs for all Ruby #{RUBY_VERSION} gemfiles"
task :spec, :files do |t, options|
Gemika::Matrix.from_ci_config.each do |row|
options = options.to_hash.merge(
:gemfile => row.gemfile,
:fatal => false,
:bundle_exec => true,
)
success = Gemika::RSpec.run_specs(options.merge(
:options => '--exclude-pattern "**/isolated/**"',
))
for_each_isolated_spec do |isolated_spec|
isolated_success = Gemika::RSpec.run_specs(options.merge(
:files => isolated_spec,
))
success &&= isolated_success
end
success
end
end
end
def for_each_isolated_spec
Dir["spec/isolated/**/*_spec.rb"].sort.each do |isolated_spec|
yield(isolated_spec)
end
end