require "bundler/gem_tasks" require "rspec/core/rake_task" task :spec do (1..7).each { |batch| Rake::Task["spec:batch#{batch}"].invoke rescue nil } end namespace :spec do task :prepare do sh %(cd spec/test_app; bundle exec rails db:setup) end (1..7).each do |batch| RSpec::Core::RakeTask.new(:"batch#{batch}") do |t| t.fail_on_error = false unless batch == 7 t.pattern = "spec/batch#{batch}/**/*_spec.rb" end end end task :default => :spec