From a028360f5d20ec8435a600113374004b709450ac Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 27 Feb 2012 16:44:32 -0300 Subject: [PATCH] Apply migrations from all plugins before tests --- lib/tasks/plugins_tests.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tasks/plugins_tests.rake b/lib/tasks/plugins_tests.rake index ff4c178..ad1cca2 100644 --- a/lib/tasks/plugins_tests.rake +++ b/lib/tasks/plugins_tests.rake @@ -4,13 +4,18 @@ def define_task(test, plugins_folder='plugins', plugin = '*') test_files = Dir.glob(File.join(Rails.root, plugins_folder, plugin, 'test', test[:folder], '**', '*_test.rb')) desc 'Runs ' + (plugin != '*' ? plugin : 'plugins') + ' ' + test[:name] + ' tests' - Rake::TestTask.new(test[:name].to_sym => 'db:test:prepare') do |t| + Rake::TestTask.new(test[:name].to_sym => 'db:test:plugins:prepare') do |t| t.libs << 'test' t.test_files = test_files t.verbose = true end end +task 'db:test:plugins:prepare' do + Rake::Task['db:test:prepare'].invoke + sh 'rake db:migrate RAILS_ENV=test SCHEMA=/dev/null' +end + namespace :test do namespace :noosfero_plugins do tasks = [ -- libgit2 0.21.2