Sha256: d94b63fb5ffb0610fb54e8f55d8aa47b8b9fbc39b8525120e2f5a3f002542644
Contents?: true
Size: 1.31 KB
Versions: 12
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_travis_yml.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
12 entries across 12 versions & 1 rubygems