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

Version Path
active_type-2.6.1 Rakefile
active_type-2.6.0 Rakefile
active_type-2.5.1 Rakefile
active_type-2.5.0 Rakefile
active_type-2.4.1 Rakefile
active_type-2.4.0 Rakefile
active_type-2.3.4 Rakefile
active_type-2.3.3 Rakefile
active_type-2.3.2 Rakefile
active_type-2.3.1 Rakefile
active_type-2.3.0 Rakefile
active_type-2.2.0 Rakefile
active_type-2.1.2 Rakefile
active_type-2.1.1 Rakefile
active_type-2.1.0 Rakefile
active_type-2.0 Rakefile
active_type-1.10.1 Rakefile
active_type-1.10.0 Rakefile
active_type-1.9.1 Rakefile
active_type-1.9.0 Rakefile