desc "Test the core plugins and the main application"
task :the_lotdo
had_errors = falseDEFAULT_PLUGINS.each do |p|
test_name = "test_#{p}"# This nasty-ass eval hack is necessary as the tests need to run within their own little env to prevent the test_helpers etc from clobbering one another
eval <<-CODE
Rake::TestTask.new(:#{test_name} => :environment) do |t|
t.libs << "test"
t.verbose = true
t.pattern = "vendor/plugins/#{p}/test/**/*.rb"
end
CODERake::Task[test_name].invoke rescue had_errors = trueendRake::Task["test"].invoke rescue had_errors = trueRake::Task["spec"].invoke rescue had_errors = trueraise"There were test failures"if had_errors
end