Sha256: 989b0c1633125853d70925b258dd50f7d42a555bb3f7f21d51b80fc749d99987
Contents?: true
Size: 1.31 KB
Versions: 23
Compression:
Stored size: 1.31 KB
Contents
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
Version data entries
23 entries across 23 versions & 1 rubygems