Sha256: 3b72a338c5299957d0c69a247d92e2f0e16555308d7a3a011889ffdd35a934b5

Contents?: true

Size: 867 Bytes

Versions: 4

Compression:

Stored size: 867 Bytes

Contents

require 'rake'
require 'bundler/gem_tasks'

desc 'Default: Run all specs.'
task :default => 'all:spec'

task :spec do
  rspec_binary = ENV['BUNDLE_GEMFILE'].include?('rspec1') ? 'spec' : 'rspec'
  examples = ENV['SPEC'] || 'spec'
  success &= system("bundle exec #{rspec_binary} #{examples}")
end

namespace :all do

  desc "Run specs on all versions"
  task :spec do
    success = true
    for_each_gemfile do
      Rake::Task['spec'].execute
    end
    fail "Tests failed" unless success
  end

  desc "Bundle all versions"
  task :bundle do
    for_each_gemfile do
      system('bundle install')
    end
  end

end

def for_each_gemfile
  version = ENV['VERSION'] || '*'
  Dir["gemfiles/Gemfile.#{version}"].sort.each do |gemfile|
    next if gemfile =~ /.lock/
    puts '', "\033[44m#{gemfile}\033[0m", ''
    ENV['BUNDLE_GEMFILE'] = gemfile
    yield
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec_candy-0.5.1 Rakefile
rspec_candy-0.5.0 Rakefile
rspec_candy-0.4.1 Rakefile
rspec_candy-0.4.0 Rakefile